Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • As I mentioned, this does not work. Drupal becomes "dumb" and the $form_id of 'foo_form' no longer exists. I can verify this by doing an 'echo $form_id'. Only the 'search_block_form' gets picked up when not all required fields are entered on the form. However, when adding a new content, both 'foo_form' and 'search_block_form' are there. Any other ideas? Commented Jan 25, 2013 at 19:08
  • could you show the code you are using. Commented Jan 25, 2013 at 19:18
  • I added the code in my edit way above. I think you can test this yourself by creating a new content type and then adding a required field. Make sure to have a search block on the sides. Then, submit the form without filling in the required field and watch as your $form_id is missing! :( Commented Jan 25, 2013 at 19:25
  • I never knew such a hook existed, unfortunately, I have the same problem. :( If I submit the form without filling in all the required values and there is another form (i.e. search block), then this hook does not get called. ARghhh! Any other ideas? Commented Jan 25, 2013 at 20:01
  • that is strange I have tried it with search form and it still gets called. have you tried it without the case statement. Commented Jan 26, 2013 at 5:04