Javascript examples for jQuery:Form Submit
Onsubmit executing JavaScript function
<html lang="en"> <head> <title> Jonathan Beck</title> </head> /*from w w w . j a v a 2 s. c om*/ <body translate="no"> <form onsubmit=" return nbpostFn('a', 'b'); "> <textarea id="nbpost" placeholder="Create a post..."></textarea> <button>SUBMIT</button> </form> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> function nbpostFn(element,name) { console.log("WORKING"); return false; } </script> </body> </html>