CausesValidation

Discussion in 'ASP .Net' started by =?Utf-8?B?SmltSGVhdmV5?=, Apr 4, 2007.

  1. I have a web page which has a bunch of validation controls on it. The page
    also has another form which provides a couple of HTML text boxes and an HTML
    button. This functionality performs a look up.

    My problem is that when the user populates the information and presses the
    button, it causes the validation to occur on the page. How can I turn this
    off when the HTML button is pressed.

    Here is the the code for the HTML form....

    <form NAME="EMAILADDR" METHOD="post"
    Action="http://somewhere/webapps/utilities/IMCApps?request=EmailLookup">
    <span class="txtBold">Last Name: </span><input TYPE="text" Name="last"
    maxlength="25" size="25" />
    <span class="txtBold">First Name: </span><input TYPE="text" Name="first"
    Maxlength="16" Size="16" />
    <input Type="submit" class="btn" Value="Look up E-mail Address">
    </form>

    Thanks in advance for your assistance.
     
    =?Utf-8?B?SmltSGVhdmV5?=, Apr 4, 2007
    #1
    1. Advertising

  2. Howdy,

    There are several ways to solve it.
    1. Make input control runat at server by adding
    <input Type="submit" class="btn" runat="server" causesvalidation="false"
    Value="Look up E-mail Address">
    2. or set validatiogroup property of all the validation controls and buttoms
    that are linked together:
    <asp:RequiredFieldValidator runat="server" ID="val" ErrorMessage="enter some
    text" ControlToValidate="txt" ValidationGroup="SubmitDataGroup"
    Display="Dynamic" />
    <asp:Button runat="server" ID="btn" Text="Submit data"
    ValidationGroup="SubmitDataGroup"/>

    hope this helps
    --
    Milosz


    "JimHeavey" wrote:

    > I have a web page which has a bunch of validation controls on it. The page
    > also has another form which provides a couple of HTML text boxes and an HTML
    > button. This functionality performs a look up.
    >
    > My problem is that when the user populates the information and presses the
    > button, it causes the validation to occur on the page. How can I turn this
    > off when the HTML button is pressed.
    >
    > Here is the the code for the HTML form....
    >
    > <form NAME="EMAILADDR" METHOD="post"
    > Action="http://somewhere/webapps/utilities/IMCApps?request=EmailLookup">
    > <span class="txtBold">Last Name: </span><input TYPE="text" Name="last"
    > maxlength="25" size="25" />
    > <span class="txtBold">First Name: </span><input TYPE="text" Name="first"
    > Maxlength="16" Size="16" />
    > <input Type="submit" class="btn" Value="Look up E-mail Address">
    > </form>
    >
    > Thanks in advance for your assistance.
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Apr 4, 2007
    #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. Josh Anderson - remove Zs to reply

    CausesValidation not taking in Repeater control

    Josh Anderson - remove Zs to reply, Nov 20, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    Josh Anderson - remove Zs to reply
    Nov 20, 2003
  2. George Durzi

    CausesValidation of editcommandcolumn

    George Durzi, Feb 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    994
    George Durzi
    Feb 12, 2004
  3. z. f.
    Replies:
    4
    Views:
    1,370
    z. f.
    Jun 23, 2004
  4. z. f.
    Replies:
    4
    Views:
    2,286
    Peter Blum
    Jun 25, 2004
  5. Martin
    Replies:
    3
    Views:
    794
    Peter Blum
    May 21, 2005
Loading...

Share This Page