Results 1 to 2 of 2

Thread: RequiredValidator ?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2003
    Location
    Earth
    Posts
    23

    RequiredValidator ?

    <asp:TextBox id="TextBox_search" runat="server"></asp:TextBox>

    <asp:TextBox id="TextBox_subscribe" runat="server"></asp:TextBox>

    <asp:Button id="Button_search" runat="server" Text="Search"></asp:Button>

    <asp:Button id="Button_submit" runat="server" Text="Submit"></asp:Button>

    <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="Email must not left blank" ControlToValidate="TextBox_subscribe"></asp:RequiredFieldValidator>

    ========================================
    I had 2 buttons with different purpose, but when I pressed the search button for textbox_search(in empty) which I never validate to it, message error on textbox_subscribe came out "email must not left blank".
    So how to make RequiredFieldValidator only work with Button_submit not Button_search ?

    Thanks in advance.
    Last edited by Rio; Dec 4th, 2003 at 11:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width