Enable / Disable to datetime picker JQuery

At HMTL

 

<div id=”start_dateDiv”>
<span>Start Date:</span>
<input type=”text” name=”str_start_date” id=”str_start_date” style=”width: 170px”/>
</div>
<script type=”text/javascript”>
$(function() {
$( “#str_start_date” ).datepicker({
dateFormat: ‘dd M yy’,
changeMonth: true,
changeYear: true,
showOn: “button”,
buttonImage: “/images/icon_calendar.gif”,
buttonImageOnly: true,
altField: “#report_start_date”,
altFormat: “yy-mm-dd”,
yearRange: “-10:+10”
});
});
</script>

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
At Javascript

function Change(){
$(“#start_dateDiv”).children().prop(‘disabled’,false);
$(“#start_dateDiv”).children(“img”).fadeIn(“slow”);

OR
$(“#start_dateDiv”).children().prop(‘disabled’,true);
$(“#start_dateDiv”).children(“img”).fadeOut(“slow”);
}
_________________________________________________

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s