javascript - Form with two submit buttons with different actions -
so have form has 3 buttons
<td > <input type="submit" id="stsave" class="button button_save pointer" value=""/> <input type="submit" id="stsavereturn" class="button button_save_return pointer" value=""/> <button id="stcancel" class="button button_cancel pointer simplemodal-close"></button> </td>
when click save. saves , modal stays open. great
when hit cancel closes. great
however can't figure out how go making when click save , return submit form , close modal. tried add onclick() event triggers before submit seems.
here form deceleration looks like.
<form:form method="post" action="${ctx_path}/admin/statepost" commandname="detailsdto" enctype="multipart/form-data">
you use jquery listen submit event of stsavereturn
input.
for example:
$('#stsavereturn').submit(function(e) { e.preventdefault(); $('#modal').modal('hide'); return false; });
wiki
Comments
Post a Comment