client side validation order; making it fail fast.

T

tomisarobot

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.
 
T

tomisarobot

found it myself.

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

unfortunate how difficult certain things are to google.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top