jquery-ui
  • jquery-ui-button
  • 2013-08-12 56 views 0 likes 
    0
    <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,datepicker和時間選擇器正常工作,我的更新按鈕啓用了選擇結束時間。但是當我使用jQuery UI按鈕給一個漂亮的外觀,以我的按鈕,這個代碼jQuery UI的按鈕創建故障

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

    雖然我得到的樣式,但我的更新按鈕永遠不會被啓用。

    回答

    1

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

    嘗試查看jQuery的文檔here

    +0

    感謝的人。工作真棒... – RatDon

    相關問題