2/12/09

RequiredFieldValidator in a MOSS datetimecontrol

If you want to control data in MOSS datetime controls yo have to specify the control to validate. The structure is similar to this: [columnName]$[columName]'Date'
You have an example in next lines:

<SharePoint:DateTimeControl ID="fechaDoc" runat="server" AutoPostBack="false" DateOnly="true" LocaleId="3082" />

<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="fechaDoc$fechaDocDate" ErrorMessage="Controles/Imgs/admiracion.gif' alt='Required Field' />" />

<asp:CompareValidator id="CVFecha" runat="server" ForeColor="Red" ControlToValidate="fechaDoc$fechaDocDate" Type="Date" Operator="DataTypeCheck" ErrorMessage="Controles/Imgs/admiracion.gif' alt='Incorrect Data' />" />