PC Review


Reply
Thread Tools Rate Thread

client side validation order; making it fail fast.

 
 
tomisarobot@gmail.com
Guest
Posts: n/a
 
      29th May 2007
Basically a javascript confirm in a CustomValidator based on some
business logic.

I have a textbox which needs a valid float, so I give it a
RequiredFieldValidator and a CompareValidator with a datatype check.
The text box also checks some business rules thereafter, and throws up
a javascript confirm.

If I put 14a in the box, I don't see the confirm dialog
If I erase the contents it checks the ReqField and then throws up the
javascript confirm dialog.

Its displaying the ReqField text before I see the javascript alert, so
I know its firing.

I've tried checking the args to see if they are already set to false,
they come preset to true. Which I find odd, because if I manually set
them to true it ignores my other validation. That's neither here nor
there though.

Is there a way to check if my other validators have already returned
false? I really hate the javascript nag to begin with, especially if
I already know that its moot.

 
Reply With Quote
 
 
 
 
tomisarobot@gmail.com
Guest
Posts: n/a
 
      29th May 2007
found it myself.

if (!Page_IsValid) { alert('not valid to begin with'); return; }

unfortunate how difficult certain things are to google.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
How to execute client-side code _after_ client-side validation? Bogdan Microsoft ASP .NET 2 9th Jun 2008 02:31 PM
Making the same button do client side javascript and server side vbscript? COHENMARVIN Microsoft ASP .NET 2 20th Oct 2005 02:13 AM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= Microsoft ASP .NET 1 2nd Jun 2005 10:45 PM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt Microsoft ASP .NET 14 30th Jan 2004 09:15 AM
validation summary doesnt display when there's client-side validation Libs Microsoft ASP .NET 0 25th Jun 2003 04:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:27 PM.