ASP.Net 2.0 required field validator.

Discussion in 'ASP .Net' started by spidur1, Nov 9, 2005.

  1. spidur1

    spidur1 Guest

    For some reason these fields are not being validated before the
    postback. Here the HTML page. Am I missing something from the
    validator controls that needs to be set?


    <table cellpadding="0" cellspacing="0" style="padding-top:0;
    padding-bottom:0; padding-left:0; padding-right:0;" width="800">
    <tr style=" background-color : #5D7B9D;">
    <td colspan="2">
    <asp:Label ID="Label5" runat="server"
    Font-Size="Large" ForeColor="White" Text="Insert New Premium
    Multiplier"
    Width="432px"></asp:Label></td>
    </tr>
    <tr>
    <td style=" width: 400px;">
    <asp:Label ID="Label3" runat="server"
    Font-Bold="True" Text="Description" Width="200px"></asp:Label></td>
    <td style=" width: 400px;">
    <asp:Label ID="Label4" runat="server"
    Font-Bold="True" Text="Multi" Width="296px"></asp:Label>
    </td>

    </tr>
    <tr>
    <td style=" width: 400px; vertical-align:top;">
    <asp:TextBox ID="txtDescriptionMain" runat="server"
    Width="350px"></asp:TextBox><br />
    <asp:RequiredFieldValidator
    ID="RequiredFieldValidatorD" runat="server"
    ControlToValidate="txtDescriptionMain"
    ErrorMessage="Description is Required"
    Display="Dynamic" ValidationGroup="Insert"
    SetFocusOnError="True"></asp:RequiredFieldValidator>
    </td>
    <td style=" width: 400px; vertical-align:top;">
    <asp:TextBox ID="txtMultiMain"
    runat="server"></asp:TextBox><br />
    <asp:RequiredFieldValidator
    ID="RequiredFieldValidatorX" runat="server"
    ControlToValidate="txtMultiMain" ErrorMessage="Please Supply a Premium
    Multiplier" ValidationGroup="Insert"
    Display="Dynamic"></asp:RequiredFieldValidator>
    <asp:CompareValidator
    ID="CompareValidatorX" runat="server" ControlToValidate="txtMultiMain"
    ErrorMessage="Please Supply a Valid Integer" Operator="DataTypeCheck"
    Type="Integer" ValidationGroup="Insert"
    Display="Dynamic"></asp:CompareValidator>

    </td>
    </tr>
    <tr>
    <td style=" width: 400px; height: 35px;
    vertical-align:bottom;">
    <asp:LinkButton ID="LinkButton3" runat="server"
    ValidationGroup="Insert">Insert Record</asp:LinkButton></td>
    <td style=" width: 400px;">
    </td>

    </tr>
    </table>
    spidur1, Nov 9, 2005
    #1
    1. Advertising

  2. spidur1

    Bruce Barker Guest

    you forget to include a ValidationSummary control, so there is no way to
    display a validation error.

    -- bruce (sqlwork.com)

    "spidur1" <> wrote in message
    news:...
    > For some reason these fields are not being validated before the
    > postback. Here the HTML page. Am I missing something from the
    > validator controls that needs to be set?
    >
    >
    > <table cellpadding="0" cellspacing="0" style="padding-top:0;
    > padding-bottom:0; padding-left:0; padding-right:0;" width="800">
    > <tr style=" background-color : #5D7B9D;">
    > <td colspan="2">
    > <asp:Label ID="Label5" runat="server"
    > Font-Size="Large" ForeColor="White" Text="Insert New Premium
    > Multiplier"
    > Width="432px"></asp:Label></td>
    > </tr>
    > <tr>
    > <td style=" width: 400px;">
    > <asp:Label ID="Label3" runat="server"
    > Font-Bold="True" Text="Description" Width="200px"></asp:Label></td>
    > <td style=" width: 400px;">
    > <asp:Label ID="Label4" runat="server"
    > Font-Bold="True" Text="Multi" Width="296px"></asp:Label>
    > </td>
    >
    > </tr>
    > <tr>
    > <td style=" width: 400px; vertical-align:top;">
    > <asp:TextBox ID="txtDescriptionMain" runat="server"
    > Width="350px"></asp:TextBox><br />
    > <asp:RequiredFieldValidator
    > ID="RequiredFieldValidatorD" runat="server"
    > ControlToValidate="txtDescriptionMain"
    > ErrorMessage="Description is Required"
    > Display="Dynamic" ValidationGroup="Insert"
    > SetFocusOnError="True"></asp:RequiredFieldValidator>
    > </td>
    > <td style=" width: 400px; vertical-align:top;">
    > <asp:TextBox ID="txtMultiMain"
    > runat="server"></asp:TextBox><br />
    > <asp:RequiredFieldValidator
    > ID="RequiredFieldValidatorX" runat="server"
    > ControlToValidate="txtMultiMain" ErrorMessage="Please Supply a Premium
    > Multiplier" ValidationGroup="Insert"
    > Display="Dynamic"></asp:RequiredFieldValidator>
    > <asp:CompareValidator
    > ID="CompareValidatorX" runat="server" ControlToValidate="txtMultiMain"
    > ErrorMessage="Please Supply a Valid Integer" Operator="DataTypeCheck"
    > Type="Integer" ValidationGroup="Insert"
    > Display="Dynamic"></asp:CompareValidator>
    >
    > </td>
    > </tr>
    > <tr>
    > <td style=" width: 400px; height: 35px;
    > vertical-align:bottom;">
    > <asp:LinkButton ID="LinkButton3" runat="server"
    > ValidationGroup="Insert">Insert Record</asp:LinkButton></td>
    > <td style=" width: 400px;">
    > </td>
    >
    > </tr>
    > </table>
    >
    Bruce Barker, Nov 9, 2005
    #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. Jinsong Liu

    Required Field Validator Client side popup

    Jinsong Liu, Aug 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    5,492
    Guenther Liebowitz
    Aug 14, 2003
  2. Do
    Replies:
    3
    Views:
    4,412
    Mike Moore [MSFT]
    Oct 23, 2003
  3. Jim Heavey

    Required Field Validator

    Jim Heavey, Nov 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    323
    Jim Heavey
    Nov 14, 2003
  4. Mr. x
    Replies:
    0
    Views:
    323
    Mr. x
    Nov 30, 2003
  5. jr
    Replies:
    3
    Views:
    414
Loading...

Share This Page