$(function () { $('#txtDate').datepicker({ showOn: "button", buttonImage: "calender_icon.gif", width: 18, height: 18, buttonText: "", buttonImageOnly: true, dateFormat: 'mm/dd/yy', onSelect: function () { $(this).datetimepicker("hide"); $('#errormessage').html(''); } }); });