Hello rkbnair,
[quoted text, click to view] > If so, how will the expression code look like?
Without actually checking the date itself:
^\d{1,2}/\d{1,2}/\d{2}$
There are more complex expressions going around that actually check the entered
text for correctness (even check for leap years), but it would be better
to use a custom validator and parse the contents both clientside and server
side for that.
Jesse
[quoted text, click to view] > "Jesse Houwing" wrote:
>
>> Hello rkbnair,
>>
>>> In the below listed code, I can force the users to enter date in
>>> mm/dd/yy
>>> format.
>>> I tried the dataformat method. But it does no validation at all.
>>> <asp:templatefield HeaderText="Ist Installed On" >
>>> <edititemtemplate>
>>> <asp:TextBox
>>> ID="gTextBox_dte_install1st" runat="server" Text='<%#
>>> Bind("dte_install1st")%>' OnChange="NumericValidation(this.id)">
>>> </asp:TextBox>
>>> </edititemtemplate>
>> You could use a RegularExpressionValidator, or get yourself a license
>> for Peter's Date Package (
http://www.peterblum.com).
>>
>> --
>> Jesse Houwing
>> jesse.houwing at sogeti.nl
--
Jesse Houwing
jesse.houwing at sogeti.n