J
Jim Heavey
Hello I have a DataList control with a couple of text boxes and a couple of
RequiredField Validators and Regular Expression Validators, but they are
not doing anything.
When I blank out the value in the field, neither of the Required field
validators are posting an error. I set the "causesValidation" property on
the button to "true". What have I done incorrectly?
Here is the (abbreviate) HTML code....
<EditItemTemplate>
<asp:TextBox ID="txtEditSeq" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem,"Sort_Order")%>' Width="40px" >
</asp:TextBox>
<asp:RequiredFieldValidator ID="rqdfldSequence" Display="Dynamic"
ControlToValidate="txtEditSeq" ErrorMessage="Field Requires
Input"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="rglrSequence" Display="Dynamic"
ControlToValidate="txtEditSeq" ValidationExpression="[1-
99]"
ErrorMessage="Must be numeric and between 1 - 99">
</asp:RegularExpressionValidator>
<asp:TextBox Runat="server" ID="txtEditNarrative" Width="840px"
Height="80px" TextMode="MultiLine" Text='<%# DataBinder.Eval
(Container.DataItem, "Descrp") %>'>
</asp:TextBox>
<asp:RequiredFieldValidator ID="rqdfldEditNarrative"
Display="Dynamic" ControlToValidate="txtEditNarrative"
ErrorMessage="Field Requires Input">
</asp:RequiredFieldValidator>
RequiredField Validators and Regular Expression Validators, but they are
not doing anything.
When I blank out the value in the field, neither of the Required field
validators are posting an error. I set the "causesValidation" property on
the button to "true". What have I done incorrectly?
Here is the (abbreviate) HTML code....
<EditItemTemplate>
<asp:TextBox ID="txtEditSeq" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem,"Sort_Order")%>' Width="40px" >
</asp:TextBox>
<asp:RequiredFieldValidator ID="rqdfldSequence" Display="Dynamic"
ControlToValidate="txtEditSeq" ErrorMessage="Field Requires
Input"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="rglrSequence" Display="Dynamic"
ControlToValidate="txtEditSeq" ValidationExpression="[1-
99]"
ErrorMessage="Must be numeric and between 1 - 99">
</asp:RegularExpressionValidator>
<asp:TextBox Runat="server" ID="txtEditNarrative" Width="840px"
Height="80px" TextMode="MultiLine" Text='<%# DataBinder.Eval
(Container.DataItem, "Descrp") %>'>
</asp:TextBox>
<asp:RequiredFieldValidator ID="rqdfldEditNarrative"
Display="Dynamic" ControlToValidate="txtEditNarrative"
ErrorMessage="Field Requires Input">
</asp:RequiredFieldValidator>