I have a form on a page. Inside it I have an element. If javascript is on, I want to disable the submit event. And handle the action in MyMethod using Ajax. How do I prevent the submit event from firing?
I believe something of the form: event.preventDefault() would do the trick. But I cant figure out how to pass in the event.
Thanks!
You could subscribe to the
.submit()event of the form and return false from it:or: