Following these steps I am able to get the following page in my firefox browser:

{ "status": true, "data": "\x3cdiv class=\"messages status\"\x3e\nCongratulations, you entered valid data. Unfortunately, nothing was saved because this is a demo.\x3c/div\x3e\n", "settings": { "ahah": { "edit-billing-info-usage": { "url": "/ahah_helper/billing_info", "event": "change", "keypress": null, "wrapper": "billing-info-wrapper", "selector": "#edit-billing-info-usage", "effect": "none", "method": "replace", "progress": { "type": "throbber" }, "button": false } } } }

I don't really know where the problem might be, what you can do to repeat this error is the following:

1) Visit the demo URL: ahah_helper_demo
2) Fill up the VAT number in a wrong way.
3) Submit the form
4) An form_set_error message must show up saying that the VAT is not valid
5) Now select "Usage: private"
6) Try to submit again

Any clues about why does this happen ?
Regards.

Comments

yonailo’s picture

Just one note about my previous message, the text "Congratulations bla bla bla..." is not important, the important thing (for me) is that I am receiving a blank page with the JSON information, in my previous example it is:

{ "status": true, "data": "\x3cdiv class=\"messages error\"\x3e\nInvalid VAT number.\x3c/div\x3e\n\x3cdiv .......[snipped]

Thanks again for your help.

gapa’s picture

I confirm this issue with repeating step mentioned by "unknownguy".

gbernier’s picture

I've had this issue happen on forms I'm using ahah helper on as well where somehow the redirect is getting broken and is redirecting to the ahah helper path which isn't right. One way this was dealt with was setting form_state['storage'] to null at the bottom of my submit function.

Hopefully this can be resolved or have a standardized way of dealing with it with a new update. If I find a solution I'll post it here

willowmedia’s picture

This problem appears to have been fixed in 6.x-2.x-dev using patch #10 http://drupal.org/node/578252#comment-2536114 but looking at the latest code, it looks like the patch was missed out when 6.x-2.1 was built.

I'm going to try and re-apply patch #10 and see if that fixes the problem.

willowmedia’s picture

Priority: Normal » Critical
Status: Active » Needs review

Update.. I have re-applied patch #10 to my ahah_helper.module and it fixes the problem I was having with my form.

Can someone review this so that we can get this added back into the official release ? Thanks.

liquidcms’s picture

just reporting that 6.x-2.1 worked fine on my Win7 dev box; but when moving to my linux server i got the error reported here.

when i applied the patch from #4 - it fixed the issue on my server.

Rene Hostettler’s picture

I was having problems setting $form_state['redirect'] in my submit handler was trying to change the redirect destination depending on user selected values in the form. Had it working before the form was enabled with #ahah then broke. Im using latest dev version.

gbernier solution http://drupal.org/node/945100#comment-3600798 solves the issue for me. Clear the storage array in the submit handler before setting $form_state['redirect'] then all is well:-)

unset($form_state['storage']);

There is more info here http://drupal.org/node/513322#comment-2070936 on why this happens as it is to do with the way function drupal_process_form works