Rquired field validator - client side problem

Discussion in 'ASP .Net' started by RA, Oct 15, 2003.

  1. RA

    RA Guest

    Hi

    How do I disable it if the user pressed a button:
    asp:imagebutton id="btnHome" onclick="test()" runat="server"

    What I want to have is that if someone presses this button then the required
    field validator won't be activated so the user can move out of the current
    page.
    RA, Oct 15, 2003
    #1
    1. Advertising

  2. Hi,

    First, you'll want an HTML button so that you can more easily add
    client-side script to its click event. Then you will want to disable the
    validation control by calling ValidatorEnable(RequiredFieldValidator,
    false).

    For more information, see
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
    /aspplusvalid.asp and search within it for the text ValidatorEnable. It
    includes sample code.

    I hope this helps.

    Thank you, Mike
    Microsoft, ASP.NET Support Professional

    Microsoft highly recommends to all of our customers that they visit the
    http://www.microsoft.com/protect site and perform the three straightforward
    steps listed to improve your computer’s security.

    This posting is provided "AS IS", with no warranties, and confers no rights.

    --------------------
    > From: "RA" <>
    > Subject: Rquired field validator - client side problem
    > Date: Wed, 15 Oct 2003 13:31:58 -0500
    > Lines: 10
    > X-Priority: 3
    > X-MSMail-Priority: Normal
    > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    > Message-ID: <>
    > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > NNTP-Posting-Host: dialup-67.27.136.33.dial1.minneapolis1.level3.net

    67.27.136.33
    > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    > Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184393
    > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    > Hi
    >
    > How do I disable it if the user pressed a button:
    > asp:imagebutton id="btnHome" onclick="test()" runat="server"
    >
    > What I want to have is that if someone presses this button then the

    required
    > field validator won't be activated so the user can move out of the current
    > page.
    >
    >
    >
    Mike Moore [MSFT], Oct 16, 2003
    #2
    1. Advertising

  3. RA

    RA Guest

    Yes but I have many asp buttons and if the user clickes any one of them I
    would like to disable the validation. How do I add client side script to asp
    buttons?


    Thanks,
    Ron

    ""Mike Moore [MSFT]"" <> wrote in message
    news:Q2rQ#...
    > Hi,
    >
    > First, you'll want an HTML button so that you can more easily add
    > client-side script to its click event. Then you will want to disable the
    > validation control by calling ValidatorEnable(RequiredFieldValidator,
    > false).
    >
    > For more information, see
    >

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
    > /aspplusvalid.asp and search within it for the text ValidatorEnable. It
    > includes sample code.
    >
    > I hope this helps.
    >
    > Thank you, Mike
    > Microsoft, ASP.NET Support Professional
    >
    > Microsoft highly recommends to all of our customers that they visit the
    > http://www.microsoft.com/protect site and perform the three

    straightforward
    > steps listed to improve your computer's security.
    >
    > This posting is provided "AS IS", with no warranties, and confers no

    rights.
    >
    > --------------------
    > > From: "RA" <>
    > > Subject: Rquired field validator - client side problem
    > > Date: Wed, 15 Oct 2003 13:31:58 -0500
    > > Lines: 10
    > > X-Priority: 3
    > > X-MSMail-Priority: Normal
    > > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    > > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    > > Message-ID: <>
    > > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > > NNTP-Posting-Host: dialup-67.27.136.33.dial1.minneapolis1.level3.net

    > 67.27.136.33
    > > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    > > Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet:184393
    > > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > >
    > > Hi
    > >
    > > How do I disable it if the user pressed a button:
    > > asp:imagebutton id="btnHome" onclick="test()" runat="server"
    > >
    > > What I want to have is that if someone presses this button then the

    > required
    > > field validator won't be activated so the user can move out of the

    current
    > > page.
    > >
    > >
    > >

    >
    RA, Oct 16, 2003
    #3
  4. Hi,

    That's a difficult subject. When you have asp buttons and validators on the
    same page, the validators "take over" the button's click event and it's
    tricky to get it back.

    There are seven or so ways to get the click event back listed on this web
    site, including sample code. Good luck.
    http://authors.aspalliance.com/kenc/faq6.aspx

    Thank you, Mike
    Microsoft, ASP.NET Support Professional

    Microsoft highly recommends to all of our customers that they visit the
    http://www.microsoft.com/protect site and perform the three straightforward
    steps listed to improve your computer’s security.

    This posting is provided "AS IS", with no warranties, and confers no rights.


    --------------------
    > From: "RA" <>
    > References: <>

    <Q2rQ#>
    > Subject: Re: Rquired field validator - client side problem
    > Date: Wed, 15 Oct 2003 22:10:04 -0500
    > Lines: 70
    > X-Priority: 3
    > X-MSMail-Priority: Normal
    > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    > Message-ID: <un#>
    > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > NNTP-Posting-Host: dialup-67.24.71.97.dial1.minneapolis1.level3.net

    67.24.71.97
    > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    > Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184506
    > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    > Yes but I have many asp buttons and if the user clickes any one of them I
    > would like to disable the validation. How do I add client side script to

    asp
    > buttons?
    >
    >
    > Thanks,
    > Ron
    >
    > ""Mike Moore [MSFT]"" <> wrote in message
    > news:Q2rQ#...
    > > Hi,
    > >
    > > First, you'll want an HTML button so that you can more easily add
    > > client-side script to its click event. Then you will want to disable the
    > > validation control by calling ValidatorEnable(RequiredFieldValidator,
    > > false).
    > >
    > > For more information, see
    > >

    >

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
    > > /aspplusvalid.asp and search within it for the text ValidatorEnable. It
    > > includes sample code.
    > >
    > > I hope this helps.
    > >
    > > Thank you, Mike
    > > Microsoft, ASP.NET Support Professional
    > >
    > > Microsoft highly recommends to all of our customers that they visit the
    > > http://www.microsoft.com/protect site and perform the three

    > straightforward
    > > steps listed to improve your computer's security.
    > >
    > > This posting is provided "AS IS", with no warranties, and confers no

    > rights.
    > >
    > > --------------------
    > > > From: "RA" <>
    > > > Subject: Rquired field validator - client side problem
    > > > Date: Wed, 15 Oct 2003 13:31:58 -0500
    > > > Lines: 10
    > > > X-Priority: 3
    > > > X-MSMail-Priority: Normal
    > > > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    > > > X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    > > > Message-ID: <>
    > > > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > > > NNTP-Posting-Host: dialup-67.27.136.33.dial1.minneapolis1.level3.net

    > > 67.27.136.33
    > > > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    > > > Xref: cpmsftngxa06.phx.gbl

    > microsoft.public.dotnet.framework.aspnet:184393
    > > > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > > >
    > > > Hi
    > > >
    > > > How do I disable it if the user pressed a button:
    > > > asp:imagebutton id="btnHome" onclick="test()" runat="server"
    > > >
    > > > What I want to have is that if someone presses this button then the

    > > required
    > > > field validator won't be activated so the user can move out of the

    > current
    > > > page.
    > > >
    > > >
    > > >

    > >

    >
    >
    >
    Mike Moore [MSFT], Oct 16, 2003
    #4
    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,495
    Guenther Liebowitz
    Aug 14, 2003
  2. Boss302
    Replies:
    0
    Views:
    1,042
    Boss302
    Nov 21, 2006
  3. siju

    example rquired

    siju, Oct 21, 2007, in forum: C Programming
    Replies:
    4
    Views:
    376
    Jack Klein
    Oct 22, 2007
  4. rquired help

    , Nov 1, 2007, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    683
  5. Zoe Hart
    Replies:
    1
    Views:
    368
    Scott Wisniewski
    Jan 8, 2004
Loading...

Share This Page