How can I send ‘return true‘ to my submit button, if i have open .dialog of jQuery on onclick even of submit button.
I want to return true to my submit button on dialog’s ‘OK’ button. so that my form get submit.
<form>
<input type='submit' name='btn1' onclick='javascript:return test()' />
</form>
function test(){
$('#testDiv').dialog('open');
}
Dialog have 2 buttons ‘OK’ & ‘cancel’
If you’re already using jQuery, don’t use the
onclickattribute to bind your event.Look into the
.submit()function (which intercepts a normal submit event), or just use abuttonelement (instead ofinputwith submit type) and use.on()to bind the click event.