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.
-
1How did you create the form? Is it created with a my_form() function? If so, it should validate through my_form_validate().– 2phaCommented 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.– CesarCommented Dec 23, 2014 at 16:59
Add a comment
|
1 Answer
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.