java - Execute a Javascript Function Upon Submitting a Spring Form -


i have js function want run (call asynchronous jms queue function) upon submitting.

can point me example of how inside spring form? know how $(document).ready(function(), want when posting form submission.

attaching submit handler jquery:

html:

<form id="form1" action="#" method="post">    <input type="text" name="field1" />    <input type="submit" /> </form> 

javascript:

$(document).ready(function() {   $('#form1').submit(function() {     alert('handler .submit() called.');   }); }); 

regarding use of spring, spring form tag generate usual html form. can specify id (or class) , attach handler jquery. link example: http://jsfiddle.net/kolchytsky/wy47g/


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -