I am selecting a form’s submit button ()
For various reasons I cannot use .submit here, where e.preventDefault() works nicely. I must use .click.
(The reason being that I am following the most upvoted answer here: http://stackoverflow.com/questions/4007942/jquery-serializearray-doesnt-include-the-submit-button-that-was-clicked , to try to include the submit button’s value on a .serialized form. jquery’s .serialize and .serializeArray do not include the submit button in their values.)
This does not work:
$(“#myFormsSubmit”).click(e) {
e.preventDefault()
});
The form is still submitted.
What can I do to prevent the form from being submitted here?