Apr 21, 2010, 7:27 AM
JavaScript has been called twice
Hello All,
On the radio button change i am calling Javascript function. and through javascript function i am disabling one text box. but its not working because javascript is called twice.
following code is present in my .aspx page for radiobutton
<ext:Radio ID="RadioGroupCashEdit" Checked="true" runat="server" BoxLabel="Cash"
GroupName="PaymentMode" >
<Listeners>
<Check Handler="return fnRadioButton('Cash');" />
</Listeners>
</ext:Radio>
</td>
<td>
<ext:Radio ID="RadioGroupAccountEdit" runat="server" BoxLabel="Account" GroupName="PaymentMode"
>
<Listeners>
<Check Handler="return fnRadioButton('Account');" />
</Listeners>
</ext:Radio>
</td>
<td>
<ext:Radio ID="RadioGroupChequeEdit" runat="server" BoxLabel="Cheque" GroupName="PaymentMode" TabIndex="3">
<Listeners>
<Check Handler="return fnRadioButton('Cheque');" />
</Listeners>
</ext:Radio>
following is the javascript function
function fnRadioButton(mode)
{
if (mode == "Cash") {
document.getElementById("txtBank").disable d = true;
}
else {
document.getElementById("txtBank").disable d = false;
}
return true;
}
this is not working since above function is fetting called twice
On the radio button change i am calling Javascript function. and through javascript function i am disabling one text box. but its not working because javascript is called twice.
following code is present in my .aspx page for radiobutton
<ext:Radio ID="RadioGroupCashEdit" Checked="true" runat="server" BoxLabel="Cash"
GroupName="PaymentMode" >
<Listeners>
<Check Handler="return fnRadioButton('Cash');" />
</Listeners>
</ext:Radio>
</td>
<td>
<ext:Radio ID="RadioGroupAccountEdit" runat="server" BoxLabel="Account" GroupName="PaymentMode"
>
<Listeners>
<Check Handler="return fnRadioButton('Account');" />
</Listeners>
</ext:Radio>
</td>
<td>
<ext:Radio ID="RadioGroupChequeEdit" runat="server" BoxLabel="Cheque" GroupName="PaymentMode" TabIndex="3">
<Listeners>
<Check Handler="return fnRadioButton('Cheque');" />
</Listeners>
</ext:Radio>
following is the javascript function
function fnRadioButton(mode)
{
if (mode == "Cash") {
document.getElementById("txtBank").disable d = true;
}
else {
document.getElementById("txtBank").disable d = false;
}
return true;
}
this is not working since above function is fetting called twice