I have a input box with ui calendar on it. I want to disable the input box so that the calendar doesn’t open on user focus of mouse to the input field.
I have used $('#enddate').attr('readonly', true); to disable the input box, but still the calendar opens on clicking the input box.
The code snippet that I have used is as follows:
$('.starttime').click(function(){
atype=$('input:radio[name=startdate]:checked').val();
if(atype==2){
$('#enddate').attr('readonly', true);
}
else
$('#enddate').attr('readonly', false);
});
try this man: http://jsfiddle.net/4U7BS/ extra in this demo – http://jsfiddle.net/VjadE/ (from date will not open the calendar because its
disabledand to field will and I reckon thats what you want:)I hope your DOM and rest Jquery is correct!
Hope it helps the cause!
code
to enable