I've been using jquery 1.6 with no problem. Today I switched to jquery 1.8 and suddenly I am getting this error when trying to submit a form:
TypeError: e[h] is not a function.
Form:
<form method="post" action="login?login" name="login" id="login">
<input class="input" type="text" name="user_mail" id="user_mail" autocomplete="on" />
<input class="input" type="password" name="password" id="password" autocomplete="off" />
<a class="green_button" href="javascript:void(0)" id="login_button">Login</a>
<input type="submit" name="login" id="submit" style="visibility:hidden" />
</form>
<script language="javascript">
$("#login_button").click(function(){
$("#login").submit();
});
</script>
Am I missing something?
Thanks!
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function.
onclick is not a function" error occurs, because there is no onclick() function in jQuery. To solve the error, use the click function instead, e.g. $('#btn'). click(function () {} .
Remove the line below.
<input type="submit" name="login" id="submit" style="visibility:hidden" />
Update:
Or if you have to use the submit input, then you need to change the id submit
to something else. The reason is that if you have an input element with id
of submit
, it will set a submit
property to the form with the HTMLInputElement. So you could not call the .submit
method on the HTMLFormElement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With