2010-07-08 129 views
1

嗯,我回来了...我试图让jQuery UI的按钮和对话框插件与我的表单一起工作。我想重置按钮jQuery UI对话框和按钮刷新

<button id="opener" value="reset" type="submit">Reset</button> 

拉起确认对话框,它做。取消应该关闭对话框并将按钮设回原来的状态。它解散罚款,但按钮保持其悬停状态,即使我已经尝试添加.refresh方法几乎无处不在我能想到的。

jQuery(document).ready(function($) { 

$(".dialog").dialog({ 
      autoOpen: false, 
      resizable: false, 
      modal: true, 
      title: 'Warning!', 
      close: function() { 
       $('#opener').button('refresh'); 
       }, 
      buttons: { 
       'Continue': function() { 
        $(this).dialog('close');  
       }, 
       Cancel: function() { 
        $(this).dialog('close'); 
        $('#opener').button('refresh') 
       } 
      } 
     }); 


$('#opener').click(function() { 
      $('.dialog').dialog('open'); 
      $(this).button('refresh') 
      return false; 
     }); 
}); 

然后在一个继续响应按钮应该继续其原来的目的..哪些没有发生。我得到一个回报:错误的行为w/o返回:任何地方为false。

回答

1

有人在jQuery的论坛上回答我的第一部分,我需要

close: function() { 
$('#opener').removeClass('ui-state-focus'); 
}, 

添加到对话框的命令。和

$('#myform').submit(); 

到了继续功能