Delaying the appearance of a modal dialog

Delaying the appearance of a modal dialog

I have a modal dialog form that pops up when a button is selected on a page.
The problem is that my mouse button seems bounce, so that one click not only
brings up the modal dialog but also clicks the submit button on modal dialog if the
two buttons have overlapping XY, so that the modal dialog form gets submitted before anything is
filled in.

I  thought I might delay the opening of the modal dialog by 100ms with setTimeout,
to give the button time to settle, but my first attempt at this, below, didn't work:

Changing
            $("#sendButton").button().click(function() { $('#dialog-form').dialog('open'); });

to:

   $("#sendButton").button().click(function() { $setTimeout('#dialog-form'.dialog('open'), 100) });

With this change the modal dialog doesn't come up at all.

Does anyone have any suggestions how I might get this to work?

Thanks for any ideas.

  1. $("#dialog-form").dialog({ autoOpen: false, height: 350, width: 375, modal: true, resizable: false, height: 'auto',
               buttons: { 'Send': function() {  
                   document.getElementById('faxForm').submit();
                   order.length = 0;
                   $(this).dialog('close');
               }        // end defning "Send" button function
    }  // end buttons
               }
          );  /* end of setting up the jQuery dialog  */

              $("#sendButton").button().click(function() { $setTimeout('#dialog-form'.dialog('open'), 100) });