"There was a problem with the request" error when FORM is submit with RETURN key
-
We believe we have discovered a bug. If a user hits RETURN on an email field (instead of clicking SUBMIT button) a pop-up appears with the following message:
There was a problem with the request.
However, the FORM is still posted and the email is processed with no issue. This seems to be because the email input field has the following event defined:
onkeypress="if(event.keyCode==13) es_submit_pages('<SITE URL>')"
Instead, it should be:
onkeypress="if(event.keyCode==13) return es_submit_pages('<SITE URL>')"
AND the plugin should prevent the RETURN key from initiating a form submit.
For now, we have resolved this issue with the following Javascript:
jQuery("#es_txt_email_pg").removeAttr("onkeypress"); jQuery('#es_txt_email_pg').on('keyup keypress', function(e) { var keyCode = e.keyCode || e.which; if (keyCode === 13) { e.preventDefault(); return false; } }); jQuery('#es_txt_email_pg').bind('keypress', function(e) { if(e.keyCode==13){ return es_submit_pages('<SITE URL>'); } });
- The topic ‘"There was a problem with the request" error when FORM is submit with RETURN key’ is closed to new replies.