how to run js before submit html 1

how to run js before submit html

function do_something(){ // Do your stuff here return true; // submit the form return false; // don't submit the form }

Here is what the above code is Doing:
1. The form is submitted.
2. The function do_something() is called.
3. The function returns true, so the form is submitted.
4. The function returns false, so the form is not submitted.

Similar Posts