<form name="formUnbook" method="post" action='<%=response.encodeURL("dist-sales-order-edit.do")%>'>
<input type="hidden" name="formName" value=<%=formName%>>
<input type="hidden" name="docTableItem" value="<%=docTableItem%>">
<input type="hidden" name="docKeyItem" value="<%=docKeyItem%>">
<%eventCalendarLinkName = "UnBook";%>
<a class="smalllink4" href="#" onClick="fnUnbook();"><%=eventCalendarLinkName%></a>
</form>
......................................................................................
<script language="JavaScript">
function fnUnbook(){
answer = confirm('<%=bundle.getString("label_areYouSure")%>');
if(answer)
{
this.form.submit();
}
}
</script>
This.form.submit(); doesn't submit the form. Any suggestion? I also tried document.form.submit(); but doesn't worked. Where is the problem?
change this.form.submit(); to document.getElementsByName("formUnbook")[0].submit();
Try modifying your code like that (add id to the form):
<form name="formUnbook" id="formUnbook" method="post" action='<%=response.encodeURL("dist-sales-order-edit.do")%>'>
<!-- other stuff here -->
<script type="text/javascript">
function fnUnbook() {
if( confirm('<%=bundle.getString("label_areYouSure")%>') ) {
return document.getElementById('formUnbook').submit();
}
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With