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
Post a Comment