JavaScript has been called twice

  1. #1

    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") {
    &#100;ocument.getElementById("txtBank").disable d = true;
    }
    else {
    &#100;ocument.getElementById("txtBank").disable d = false;
    }
    return true;
    }



    this is not working since above function is fetting called twice
  2. #2

    RE: JavaScript has been called twice

    Hi,

    Check is called for check and uncheck actions therefore you have to check 'checked' argument
  3. #3

    RE: JavaScript has been called twice

    hello vladimir

    thanks for you help, But i didnt understand can you tell with example.


    thanks and regards

    harshad
  4. #4

    RE: JavaScript has been called twice

    Hi,

    Please see docs about Check event


    check : ( <code style="font-style: normal; font-weight: normal; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 12px; ">Ext.form.Checkbox this</code>, <code style="font-style: normal; font-weight: normal; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 12px; ">Boolean checked</code> )<div class="mdesc" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: rgb(68, 68, 68); "><div class="long" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: block; line-height: 18px; ">Fires when the checkbox is checked or unchecked.<div class="mdetail-params" style="margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 12px; font-size: 12px; "><strong style="font-style: normal; font-weight: normal; display: block; margin-bottom: 3px; font-size: 11px; color: rgb(85, 85, 85); ">Listeners will be called with the following arguments:[/b]<ul style="margin-top: 12px; margin-right: 12px; margin-bottom: 12px; margin-left: 12px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: circle; list-style-position: inside; list-style-image: initial; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-position: inside; list-style-type: circle; list-style-image: initial; "><code style="font-style: normal; font-weight: normal; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 12px; ">this</code> : Ext.form.Checkbox<div class="sub-desc" style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 16px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">This checkbox
    <li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-position: inside; list-style-type: circle; list-style-image: initial; "><code style="font-style: normal; font-weight: normal; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 12px; ">checked</code> : Boolean<div class="sub-desc" style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 16px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">The new checked value[/list]



Similar Threads

  1. Store OnLoad called on every postback
    By wexman in forum 1.x Help
    Replies: 1
    Last Post: Nov 17, 2011, 11:53 AM
  2. [CLOSED] DirectMethods not called anymore
    By wagger in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: May 04, 2011, 6:51 PM
  3. Replies: 3
    Last Post: Nov 12, 2010, 7:33 AM
  4. [1.0] ResourceManager.AjaxRequestComplete not called
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 15, 2009, 3:05 AM
  5. Prb with id called
    By plykkegaard in forum Bugs
    Replies: 0
    Last Post: Mar 26, 2009, 8:21 AM

Posting Permissions