conflict between validation controls and "confirm"

Discussion in 'ASP .Net Web Controls' started by Bob D, Jan 15, 2004.

  1. Bob D

    Bob D Guest

    I have a web form that uses several client side
    validators when user hit submit. Now users ask me to
    include a dialog box to confirm the action before
    submission. I tried to add a javascript
    function "confirm" to the form's onsubmit event, which
    turned to be appended by VS.net to a bunch of other
    validation scripts as mentioned above. Thus it couldn't
    work. Does anyone have good suggestions on how to
    accomplish this? I know there are work-arounds, such as
    sending back a page for additional confirmation. But user
    experience won't as be good.
    Thanks for your help!
     
    Bob D, Jan 15, 2004
    #1
    1. Advertising

  2. Bob D

    Teemu Keiski Guest

    Hi,
    Not sure, but you could try just rewriting the onclick attribute of the
    control that causes postback (is it button etc?).

    Anyway this would work for sure:

    on the control that causes the validation (that normally triggers it), you
    could put CausesValidation="False" to remove the default validation. Then
    append the confirm script and call to Page_ClientValidate (in JavaScript as
    well to trigger client-side validation) to the Onclick attribute . This way
    confirming happens before validation. Just on the control's postback event
    (Click with buttons) make call to Page.Validate and then check Page.IsValid
    to be sure about the validation both at client and at server
    (CausesValidation="false" causes, as the name says, that validation isn't
    triggered automatically anymore but it can still be triggered
    automatically).

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist


    "Bob D" <> wrote in message
    news:01ee01c3db44$326206d0$...
    >I have a web form that uses several client side
    > validators when user hit submit. Now users ask me to
    > include a dialog box to confirm the action before
    > submission. I tried to add a javascript
    > function "confirm" to the form's onsubmit event, which
    > turned to be appended by VS.net to a bunch of other
    > validation scripts as mentioned above. Thus it couldn't
    > work. Does anyone have good suggestions on how to
    > accomplish this? I know there are work-arounds, such as
    > sending back a page for additional confirmation. But user
    > experience won't as be good.
    > Thanks for your help!
     
    Teemu Keiski, Jan 15, 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. David Gildea

    Conflict between VS2003 and VS 2005

    David Gildea, Dec 1, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    690
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
    Dec 1, 2004
  2. ciccio
    Replies:
    4
    Views:
    488
    ciccio
    Jan 18, 2008
  3. C.W.
    Replies:
    4
    Views:
    455
  4. Dick Moores

    Conflict between msvcrt and Tkinter?

    Dick Moores, Jun 18, 2008, in forum: Python
    Replies:
    0
    Views:
    240
    Dick Moores
    Jun 18, 2008
  5. charles cashion

    css conflict (or html conflict)

    charles cashion, Feb 18, 2009, in forum: HTML
    Replies:
    2
    Views:
    823
    charles cashion
    Feb 18, 2009
Loading...

Share This Page