I have this code...
HTML
<input name="start_time" id="start_time" type="text" value="" readonly >
JQuery
$('#start_time').timepicker({
showPeriodLabels: true,
minutes: {
starts: 0,
ends: 59,
interval: 1,
manual: []
}
});
Problem:
- Timepicker still pops-up considering the field is 'readonly'.
- How can I prevent this?
- Any other work around?
Thank you guys for all the help!
You can check before that your input box have readonly property or not then apply the timepicker on that. Go with the link or below code. Hope my code helps you to understand better.
HTML Code-
<input name="start_time" id="start_time" type="text" value="" readonly >
JAVASCRIPT Code-
if(!$('#start_time').prop('readonly')){
$('#start_time').timepicker({
showPeriodLabels: true,
minutes: {
starts: 0,
ends: 59,
interval: 1,
manual: []
}
});
}