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

Push Button click handler never called

Expand Messages
  • Todd Wells
    I ve set up a button with a click handler, but it s never called... I ve tried using the onclick option as well as the button.on() method. Any ideas? This is
    Message 1 of 2 , Dec 15, 2009
    • 0 Attachment
      I've set up a button with a click handler, but it's never called... I've tried using the "onclick" option as well as the button.on() method. Any ideas? This is with 2.8.0r4 loaded via YUI loader.

      <button id="submitR" type="button" class="yui-button yui-push-button">Submit</button>

      and the code:

              var submit = new YAHOO.widget.Button("submitR", {onclick: {fn: submitR}});
              //submit.on("click", submitR); // also tried this, same behavior

      I put a breakpoint on the first line of the submitR function and it's never called. It appears that YUI actually tries to submit the form contents on the page (which is not what I want it to do) rather than calling submitR.


    • Todd Wells
      Ah, false alarm. It appears firebug got in some funky state and so was never hitting the breakpoint (and ultimately falling through to subsequent submit code,
      Message 2 of 2 , Dec 15, 2009
      • 0 Attachment
        Ah, false alarm. It appears firebug got in some funky state and so was never hitting the breakpoint (and ultimately falling through to subsequent submit code, which I thought should not be executing). Restarting Firefox resolved the issue.

        On Tue, Dec 15, 2009 at 9:39 AM, Todd Wells <ttopwells@...> wrote:
        I've set up a button with a click handler, but it's never called... I've tried using the "onclick" option as well as the button.on() method. Any ideas? This is with 2.8.0r4 loaded via YUI loader.

        <button id="submitR" type="button" class="yui-button yui-push-button">Submit</button>

        and the code:

                var submit = new YAHOO.widget.Button("submitR", {onclick: {fn: submitR}});
                //submit.on("click", submitR); // also tried this, same behavior

        I put a breakpoint on the first line of the submitR function and it's never called. It appears that YUI actually tries to submit the form contents on the page (which is not what I want it to do) rather than calling submitR.



      Your message has been successfully submitted and would be delivered to recipients shortly.