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>

my code works fine with jQuery UI, datepicker and time picker and my update button gets enabled up on selecting end time. but when i use jQuery UI button to give a nice look to my buttons, with this code

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

though i get the styles but my update button never gets enabled.

1 Answer 1

1

Try with

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

See the jQuery doc here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.