[plugin MM Forms] [0.9.6b Bug Fix] Forms Hang After Error
-
Symptom:
When filling out a validated form, the form successfully submits. However if a field error is thrown and then corrected, the form seems to hang with the spinning ajax gif by the Submit button.Cause:
After a Submit, JavaScript function mmfProcessJson is called in mm-forms.js on line 56. On error the Captcha is regenerated and it’s coded value re-inserted in the form. However upon value re-insertion, the coded Captacha value overwrites ALL hidden form values such as id, causing future validation attempts in the mm-forms.php, ajax_json_echo() to fail with an invalid array index. Thus causing the hang since there is also no error handling in this function for this case.Solution:
Since JQuery 1.2, the “@” sign was depreciated as part of the Selector Attribute Filter syntax(see API). Which is why ALL hidden form values were replaced with the Captcha value instead of the specific one indicated by the attribute filter.Simply replace mm-forms.js, line 70
jQuery(data.into).find('input:hidden[@name="_mmf_captcha_challenge_' + i + '"]').attr('value', match[1]);
with
jQuery(data.into).find(':hidden[name="_mmf_captcha_challenge_' + i + '"]').attr('value', match[1]);
`
- The topic ‘[plugin MM Forms] [0.9.6b Bug Fix] Forms Hang After Error’ is closed to new replies.