Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > conflict between validation controls and "confirm"

Reply
Thread Tools

conflict between validation controls and "confirm"

 
 
Bob D
Guest
Posts: n/a
 
      01-15-2004
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!
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      01-15-2004
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" <(E-Mail Removed)> wrote in message
news:01ee01c3db44$326206d0$(E-Mail Removed)...
>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!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
css conflict (or html conflict) charles cashion HTML 2 02-18-2009 09:41 PM
RE: wizard validation conflict =?Utf-8?B?TmF0ZQ==?= ASP .Net 0 12-22-2006 01:28 AM
where is the validation occurs for validation controls baroque Chou ASP .Net 4 01-24-2006 03:32 PM
Page appears to fail validation even though it has no validation controls =?Utf-8?B?ZGh1cndpdHo=?= ASP .Net 1 04-10-2004 07:37 AM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt ASP .Net 14 01-30-2004 09:15 AM



Advertisments