I have a form which opens in a modal CTools window. The forms submits perfectly, but when I try to use the my_form_validate() function, it never goes to that function, it always go directly to my_form_submit() function? I have tried to "uncode" the CTools modal windows example provided with the module, but I am not able to decipher it.

  • 1
    How did you create the form? Is it created with a my_form() function? If so, it should validate through my_form_validate().
    – 2pha
    Dec 23, 2014 at 16:49
  • It is rendered with AJAX: return drupal_get_form('mymodule_form'); inside the callback function, and I have a my_module_my_form function as usual. The same form works perfectly if it is called outside the AJAX function, directly.
    – Cesar
    Dec 23, 2014 at 16:59

1 Answer 1


I have just discovered that I had mistyped mymodule_my_form_validate as my_module_my_form_validate. Your reply has made me look into the function and now it works perfectly. Somehow I thought the method was much more convoluted as involved AJAX. Sorry, this is very embarrasing. In any case, your reply saved me a lot of time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.