By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

client side validation order; making it fail fast.

P: n/a
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.

May 29 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
found it myself.

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

unfortunate how difficult certain things are to google.
May 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.