Validators

Discussion in 'ASP .Net' started by Jim Heavey, May 5, 2004.

  1. Jim Heavey

    Jim Heavey Guest

    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>
     
    Jim Heavey, May 5, 2004
    #1
    1. Advertising

  2. Jim Heavey

    Jim Heavey Guest

    I was missing Runat="server" and that was the reason they were not working
     
    Jim Heavey, May 5, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William F. Robertson, Jr.

    Re: Validators

    William F. Robertson, Jr., Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    872
    William F. Robertson, Jr.
    Jun 25, 2003
  2. Marina

    All validators stopped working

    Marina, Jun 27, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    458
    Rajesh Tiwari
    Jun 27, 2003
  3. dmedina

    Validators and javascript

    dmedina, Jun 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    395
    William F. Robertson, Jr.
    Jun 30, 2003
  4. William F. Robertson, Jr.

    Validators

    William F. Robertson, Jr., Jul 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    474
    William F. Robertson, Jr.
    Jul 10, 2003
  5. Ratman
    Replies:
    0
    Views:
    715
    Ratman
    Sep 14, 2004
Loading...

Share This Page