Can anyone explain to me what this error means? I would appreciate it a lot for any kindof help with this.
<form class="form" id="form" action="/mailer.php" method="post">
The Jquery code I'm using for it is this.
$('#form').submit();
2019-01-05 02:47发布
Can anyone explain to me what this error means? I would appreciate it a lot for any kindof help with this.
<form class="form" id="form" action="/mailer.php" method="post">
The Jquery code I'm using for it is this.
$('#form').submit();
xdazz explained the issue well.
You can use a native submit method of HTMLFormElement to work around a problem:
Check the form to see whether there is a
HTMLInputElement
with id or name issubmit
.This will set a property
submit
to theHTMLFormElement
, so thesubmit
function which is in the prototype of the form element can't be executed.Example:
js:
jQuery's
.submit()
method will call the.submit()
on the original dom element, so the error will happen.If you have a button or input with the name submit or id submit, I have seen errors in IE. Make sure your inputs are correctly named. Here's an article on it http://bugs.jquery.com/ticket/1414