Reputation: 11673
Why does this script cause an error on submit in firefox? It is using jquery.
$(document).ready(function(e) {
$('#errorMessage').hide();
$('#form').submit(function() {
var firstname = $('#formFirstname').val();
if(firstname == '') {
$('#errorMessage').html('Please enter your Name.');
$('#errorMessage').fadeIn();
}
else {
$('#errorMessage').html('Please wait a moment as the form Submits.');
$('#form').submit();
}
return false;
})
});
Upvotes: 0
Views: 336
Reputation: 160853
You are aliasing the jQuery to e
.
Change $(document).ready(function(e) {
to $(document).ready(function() {
Or jQuery(document).ready(function($) {
Edit:
Although it may not cause the error, in your code e
is also jQuery
's alias, e('#form')
will also work.
Upvotes: 1