Validators

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top