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

RE: [ydn-javascript] How to stop Dialog automatically hiding on submit

Expand Messages
  • Steven Peterson
    It s not a silly question at all. The best way to modify this default behavior is to override the submit function. Currently, it looks like this:
    Message 1 of 2 , Dec 27, 2006
    • 0 Attachment

      It’s not a silly question at all. The best way to modify this default behavior is to override the submit function. Currently, it looks like this:

       

      YAHOO.widget.Dialog.prototype.submit = function() {

            if (this.validate()) {

                  this.beforeSubmitEvent.fire();

                  this.doSubmit();

                  this.submitEvent.fire();

                  this.hide();

                  return true;

            } else {

                  return false;

            }

      };

       

      You can modify it by removing the “this.hide()” call and including your new definition of this function in your JavaScript, and that will override the submit function to give it the behavior that you want.

       

       

      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!

       

       

       

      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of g_holyoak
      Sent: Wednesday, December 27, 2006 8:01 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] How to stop Dialog automatically hiding on submit

       

      Hi Guys,

      Sorry if this is a silly question but I've only just started using
      these components.

      I have a Dialog widget whose postmethod is async.

      Is there a simple way to stop the dialog.submit() method from
      automatically hiding the Dialog itself as ideally I would like to
      control this action based on the result of the XMLHttpRequest.

      I can use my own buttons but it I may be missing something simple.

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