I am trying to fire a function using Jquery when the form submit button is clicked, but the function needs to fire BEFORE the form is actually submitted.
I am trying
You can use some div or span instead of button and then on click call some function which submits form at he end.
<form id="my_form"> <span onclick="submit()">submit</span> </form> <script> function submit() { //do something $("#my_form").submit(); } </script>