【问题标题】:jquery ui button creating troublejquery ui按钮创建麻烦
【发布时间】:2013-08-12 09:46:49
【问题描述】:
<table class='dates'>
 <form method='post' action='' name='admin' id='form_admin'>
  <tr>
   <td>Start Time Of Election</td>
   <td>: <input type="text" id="stime" name='elect' placeholder='hh:mm' readonly="true"/></td>
  </tr>
  <tr>
   <td>End Time Of Election</td>
   <td>: <input type="text" id="etime" name='elect' placeholder='hh:mm' readonly="true" disabled='true'/></td>
  </tr>
  <tr>
   <td align='right'>
    <input id='enable' type='submit' name='date' value='Update' disabled='true'/>
   </td>
   <td align='right'>
    <input type='submit' name='cancel' value='Cancel'/>
   </td>
  </tr>
 </form>
</table>

<script type="text/javascript">
$(function(){
 $('#stime').timepicker({
    hourMin: 8,
    hourMax: 10,
    onSelect: function(){
     $('#etime').prop('disabled', false);
     $('#etime').timepicker({
      hourMin: 16,
      hourMax: 18,
      onSelect: function(){
        $('#enable').prop('disabled', false);
     }
    });
   }
  });
});
</script>

我的代码在 jQuery UI、日期选择器和时间选择器上运行良好,并且我的更新按钮在选择结束时间时启用。但是当我使用 jQuery UI 按钮给我的按钮一个漂亮的外观时,使用这段代码

$(function() {
    $( "input[type=submit], button" )
      .button()
      .click(function( event ) {
      });
});

虽然我得到了样式,但我的更新按钮从未启用。

【问题讨论】:

    标签: jquery-ui jquery-ui-button


    【解决方案1】:

    试试

    $("#enable").button( "enable" );
    

    查看 jQuery 文档here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-10
      • 2020-07-11
      • 2016-01-22
      • 2012-11-19
      相关资源
      最近更新 更多