title: How can I disable double click on Jquery Modal Dialog button?
body: <p>I’m using Jquery Modal Dialog for submitting some data into the server side and after that saving into database; here my modal dialog code is:</p>
  
  <pre><code>    function loadUserDialog(tag, event, target, id) {
              event.preventDefault();
  
  $.validator.unobtrusive.parse('#frmModalPopup');
  
              var $loading = $('&lt;img src="@Url.Content("~/Content/images/ajaxLoading.gif")" alt="loading" class="ui-loading-icon" style="margin: 150px 150px;"&gt;');
              var $url = $(tag).attr('href');
              var $title = $(tag).attr('title');
              var $dialog = $('&lt;div&gt;&lt;/div&gt;');
              $dialog.empty();
              $dialog
              .append($loading)
              .load($url)
                .dialog({
                    autoOpen: false
                 , title: $title
                 , width: 500
                 , modal: true
                 , minHeight: 400
                 , show: 'fade'
                 , hide: 'fade'
                });
              $dialog.dialog("option", "buttons", {
                  "Submit": function () {
                      var dlg = $(this);
                      if (IsValidUserName() &amp;&amp; $('#frmModalPopup').validate().form()) {
                          $.ajax({
                              url: $url,
                              type: 'POST',
                              data: $(target).serialize(),
                              success: function (response) {
                                  var cid = $(response).attr('id');
                                  if (cid != null &amp;&amp; cid != undefined) {
                                      $(response).fadeIn('slow').appendTo(id);
                                      $(window).scrollTop($('#' + cid).offset().top);
                                  }
  
                                  dlg.dialog('close');
                                  dlg.empty();
                              },
                              error: function (xhr) {
                                  alertMessage("EmailId is already in use!");
                                  $.validator.unobtrusive.parse('#frmModalPopup');
                              }
                          });
                      }
                  },
                  "Cancel": function () {
                      $(this).dialog('close');
                      $(this).empty();
                  }
              });
  
              $dialog.dialog('open');
          };
  </code></pre>
  
  <p>But when I do multiple clicks on Submit button at time (more than once) then form is submitted more than once and I got duplicate data submission information. So could you please tell me how to disable double click or more than once click on button Submit.</p>