Shouldn't the form generating function get executed every time the form is rendered? Because I need to update some field suffixes based on the $form_state
values and I don't know how to do this.
I have something like this:
function xxxx_some_form($form, &$form_state){
$form["some_field"] = array(
"#type" => "textfield",
"#required" => true,
// bla bla bla
);
drupal_set_message("whatever");
$form["actions"]["do_action"] = array(
"#type" => "submit",
"#value" => t("Do action"),
);
return $form;
}
When I submit the form, the validation messages are displayed ( Eg: X field is required ) but the message from drupal_set_message("whatever")
is not displayed.
Also, no other logic is executed there.