disable calender on input field on radio button select
===

i have a input bux with ui calender on it , i want to disable the input box so that the calender don'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 calender 

opens on clicking the input box.

the code snippet that i have used is as below

$('.starttime').click(function(){
	atype=$('input:radio[name=startdate]:checked').val();
	
	if(atype==2){
	    $('#enddate').attr('readonly', true);
	 }
	 else
	   $('#enddate').attr('readonly', false);
  });