Loading ...
Sorry, an error occurred while loading the content.

How to disable button of Dialog Box after one click

Expand Messages
  • Madhuri Kota
    Hi All, How do I disable button in a Dialog Box after one click. My Dialog Box defined as: var handleApplicantFormCancel = function() { hide_applicant_form();
    Message 1 of 2 , May 29, 2009
    • 0 Attachment
      Hi All,

      How do I disable button in a Dialog Box after one click.
      My Dialog Box defined as:

      var handleApplicantFormCancel = function() {
         hide_applicant_form();
         this.cancel();
      }
      var handleApplicantFormSubmit = function() {
      addApplicant();
      this.cancel();
      }
      //Container For Applicant Form Details
      BRIDLE.FeePOS.Container.ApplicantForm = new YAHOO.widget.Dialog("ApplicantFormDiv", { modal:true, visible:false, width:"350px", fixedcenter:true, constraintoviewport:true, draggable: true  } );
      var listeners = new YAHOO.util.KeyListener(document, { keys : 27 }, {fn:handleApplicantFormCancel,scope:BRIDLE.FeePOS.Container.ApplicantForm,correctScope:true} );
      BRIDLE.FeePOS.Container.ApplicantForm.cfg.queueProperty("keylisteners", listeners);
      BRIDLE.FeePOS.Container.ApplicantForm.cfg.queueProperty("buttons", [
      { text:"Next>>", handler:handleApplicantFormSubmit, isDefault:true },
      { text:"Cancel", handler:handleApplicantFormCancel } ]);
      BRIDLE.FeePOS.Container.ApplicantForm.render();

      Please help me out.

      Thanks,
      Madhuri
    • lou_tribal
      I guess that the button you want to disable after one click is the submit one, so in that case you can use: // Get the array of buttons var myButtons =
      Message 2 of 2 , May 31, 2009
      • 0 Attachment
        I guess that the button you want to disable after one click is the submit one, so in that case you can use:

        // Get the array of buttons
        var myButtons = this.getButtons();
        // Disable the first one
        myButtons[0].set("disabled", true);

        <

        --- In ydn-javascript@yahoogroups.com, Madhuri Kota <madhurikota1983@...> wrote:
        >
        > Hi All,
        > How do I disable button in a Dialog Box after one click.
        > My Dialog Box defined as:
        >
        > var handleApplicantFormCancel = function() {
        > hide_applicant_form();
        > this.cancel();
        > }
        > var handleApplicantFormSubmit = function() {
        > addApplicant();
        > this.cancel();
        > }
        > //Container For Applicant Form Details
        > BRIDLE.FeePOS.Container.ApplicantForm = new
        > YAHOO.widget.Dialog("ApplicantFormDiv", { modal:true, visible:false,
        > width:"350px", fixedcenter:true, constraintoviewport:true, draggable: true
        > } );
        > var listeners = new YAHOO.util.KeyListener(document, { keys : 27 },
        > {fn:handleApplicantFormCancel,scope:BRIDLE.FeePOS.Container.ApplicantForm,correctScope:true}
        > );
        > BRIDLE.FeePOS.Container.ApplicantForm.cfg.queueProperty("keylisteners",
        > listeners);
        > BRIDLE.FeePOS.Container.ApplicantForm.cfg.queueProperty("buttons", [
        > { text:"Next>>", handler:handleApplicantFormSubmit, isDefault:true },
        > { text:"Cancel", handler:handleApplicantFormCancel } ]);
        > BRIDLE.FeePOS.Container.ApplicantForm.render();
        >
        > Please help me out.
        >
        > Thanks,
        > Madhuri
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.