Nov
3

Tip #4: Do not use input name submit using jQuery trigger(’submit’)

That’s right, this is something I just crossed in one of my project, a form would not submit when requested with $(“form”).trigger(’submit’). This is because my submit input button was using the name.. submit, like in :

  1. <input type="submit" name="submit">

Be careful!

2 Comments to “Tip #4: Do not use input name submit using jQuery trigger(’submit’)”

  • Submit doesn’t work also if you use $(‘form’).submit() or even document.form.submit() . It’s just that “submit is not a function.” It’s an input. So naming input elements in forms “submit” is definitely a bad idea.

  • I could agree more.

Leave a comment

RSSSome Tweets