I am have a form for which I have written custom element validation. In the validation handler I am calling form_set_error on the element and the form is not being submitted. However, The messages variable is not being printed out until a page reload (or jump to different path).
I am building the form in a page callback with drupal_get_form() (it is before the theme layer). There are #title attributes on all of the form elements in the form and the validation is doing as it should (just a page late).
On my local machine it seems like the $messages variable is being correctly set, but is hitting a 404 page (and I think being printed before the redirect? (missing image)). On the server I am hosting it on it is not hitting a 404, but is printing out the $messages a page too late.
Anyone run into this before?
Comments
Comment #1
BigEngland commentedComment #2
pere orgaYou are probably calling the webform too late.
See http://drupal.stackexchange.com/q/8223/10086
Comment #3
pedrofaria commentedSorry, but it's not the wright place for Drupal Support.
Comment #4
BigEngland commentedIt was being called too late. I switched the $messages variable to be created in a preprocess node function. Thanks! netol