Edit DetailsView with regular expression validation
Hi, I have a problem using the regular expression validation.
In a detailed view I fill out a form to create record for an Employee.
I have to enter the Zip code. To validate it I use the regular expression
Then I want to edit the record later. I don’t want to edit the zip code.Tt’s bounded from the select
But the update is keeping asking to re-enter the code.
Hi, I have a problem using the regular expression validation.
In a detailed view I fill out a form to create record for an Employee.
I have to enter the Zip code. To validate it I use the regular expression
Then I want to edit the record later. I don’t want to edit the zip code.Tt’s bounded from the select
But the update is keeping asking to re-enter the code.
Code:
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SIN") %>'
ontextchanged="TextBox1_TextChanged"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="SIN required"
Text='*'
ValidationExpression="\d{3}-\d{2}-\d{4}"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server"
ControlToValidate="TextBox1" ErrorMessage="SIN is not Valid"
ValidationExpression="\d{3}-\d{2}-\d{4}">___-__-____</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ControlToValidate="TextBox1" ErrorMessage="SIN is required"></asp:RequiredFieldValidator>
</EditItemTemplate>