JSF h:selectOneMenu onchange() event issue
Hi All,
First of all i would like to thank you for your previous valuable suggestions. Currently iam working on a JSF page where i need to open a popup message if the user changes value in a dropdown list box. And if the user clicks ok in the confirm window, we need to submit the form, and if he clicks Cancel we need to retain on the same page.
My code is as follows.
----------------------------------
<h:selectOneMenu id="deductibleType" onchange="javascript:onChangeDeductibleType();" value="#propertyCoverageBBean.propertyCoverageView.deductibleType}" >
<f:selectItems value="#{propertyCoverageBBean.deductibleAmountList}"/>
</h:selectOneMenu>
function onChangeDeductibleType() {
if (!confirm('Deductible - Are you sure you want to change the deductible?')
{
return;
} else {
document.forms[0].submit();
}
}
I am able to get the confirm window popup....but when i clicked on 'Ok', nothing is happening and control remains on the same page. Could anyone please help me out on this.
Thanks
vijay