Disable Key press on SharePoint:DateTimeControl
Sharepoint DateTime control is placed in a Webpart or Application Page. We need to allow the users to select the Date from the Date Picker ICON in the DateTime Control to avoid the typing in the DateTime Control TextBox.
Here you go for the solution :
In Code behind :
JavaScript validation for SharePoint DateTime Control
Here you go for the solution :
In Code behind :
((TextBox)(dtpClearfrmCustoms.Controls[0])).Attributes.Add("readonly", "readOnly");
In Source Page :
<SharePoint:DateTimeControl ID="dtpClearfrmCustoms" runat="server"
DateOnly="true"
LocaleId="2057" />
if (document.getElementById('<%=
dtpClearfrmCustoms.Controls[0].ClientID %>').value == "") {
alert("Please select the date");
return false;
}
Hope this would helps you....
Comments
Post a Comment