By owntheweb on
Hello,
I have a custom AJAX feedback form that looks like this:
http://farm8.staticflickr.com/7152/6425392363_5d7420685c_z.jpg
I'm using Drupal's Forms API to create and handle the form. It's working GREAT and it is well loved... until one fails to enter the captcha correctly. Then it returns some errors appropriately (without refreshing the whole page which is cool), but the captcha form is missing as it needs to be reloaded using a JavaScript function call.
Any thoughts on how to call a JavaScript function when an updated form with errors is returned via AJAX/Form API?
Thanks a ton in advance for your advice!
Best regards,
Chris
Comments
Try using $form[#after_build]
Try using $form['#after_build'] for that