Using js to submit a form to solve the problem that there are multiple submit buttons on a page. It is mainly to determine whether it is a submission text and then perform the corresponding actions, which is relatively simple.
<pre name="code">function check(txt){ $j("form").submit(function(){ if($txt=="Submit"){ this.action="doAddMessage.action?button=Submit"; this.submit(); }else{ this.action="doAddMessage.action?button=Save"; this.submit(); } }); }</pre><br> <input type="IMAGE" src="style/blue/images/button/send.png" name="button" value="Submit" onclick="check(this)"/><input type="IMAGE"src="style/blue/images/button/saveToDraftBox.png" name="button" value="Save" onclick="check(this)"/> <pre></pre> <p><br> For example: There are two image buttons submitted on the page. At this time, we can bind the onclick event to them. At this time, we use the form form of jquery to have an event called submit. </p> <p>As shown in the figure, since my project uses dwr, I transfer the control of jquery to dwr, jquery re-specifies $j, we get the form, and then use the submit event to judge the value of the value, so that multiple pages can be redirected. </p> <p> </p> <p> </p>