Error "form elements must not have name or id of submit" submitting form in IE7
-
I was testing a site in IE7 and encountered an error: “form elements must not have name or id of submit”, I looked at the code of my form and I could see that neither the submit button itself nor any other form field had an id or name of submit.
It turns out the problem was that I had a div element in my form that had an ID of ‘submit’:
<div id="submit" class="quote_form_panel">
Once I changed ‘submit’ to something else then the form submitted without any problem!
I think this issue is connected with a recent change in how jQuery handles attribute selectors, I only just updated this site to WordPress 3.5.1 from 3.3, so the form had previously worked but the WP update bumped the included jQuery version up which has then caused this error. As far as I understand it CF7 iterates over the form contents via jQuery so this update / change seems the likely cause.
So it does seem like this is something that needs to be fixed in Contact Form 7, it is likely that you would (as I did) label div elements as ‘submit’ so this shouldn’t cause the form to fail. I’m not sure which other browser versions this affects, I only tested in IE7 and then fixed the problem.
Thanks!
- The topic ‘Error "form elements must not have name or id of submit" submitting form in IE7’ is closed to new replies.