Checking if the page IsValid in Javascript?!

E

Emilio

Hi,

I have a form that contains various server validation controls, the submit
button will either open a popup box or a popup window on the client-side
click event. The question is, how do I check if the page is valid before it
gets posted back to the server so the window or box only pops up if
everything is OK? At the moment the popup occurs first then the validation.

Many thanks

Emilio
 
E

Emilio

Hi,

Thanks for the reply, unfortunatly the my client-side onclick event seems to
be taking place before the Page_IsValid flag is updated from its default
true state. Is their any way I can get around this. The onclick attribute is
added in the last the last line of code in my page load event.

thanks
 
T

Teemu Keiski

It is updated right when Page_ClientValidate is called. On the article, I
mentioned, is also explained how to check the status validator by validator.
You can call Page_ClientValidate yourself also.
 
E

Emilio

Thanks Teemu,

Got it working 100%, the article doesn't mention the Page_ClientValidate
function however.

Thanks again

Emilio
 
Joined
Nov 25, 2008
Messages
4
Reaction score
0
Horrible MSDN documentation... ASP.NET Validation in Depth

ASP.NET Validation in Depth - title says validation in depth and does not discuss about Page_ClientValidate() function...

ends with overconfident line

"That's It
This is probably more than you wanted to know about ASP.NET validation. Have fun with it! "

he is a piece*, Quality by Microsoft documentation goes SUCCCCCCCCKS!
 
Joined
Feb 18, 2011
Messages
1
Reaction score
0
Hi,
I have 2validators on my page i.e Custom validator and a Required feild validator.Both have diffferent validation group.Custom validator gets fired only on Delete button click wheres the Required feild Validators are supposed to be fired on Add and Update button.

I am using java script to do so..and is showing Validation summary on a pop-up control.

The issue is when i call the Page_ClientValidate() method and check the Page_IsValid property..i always get it false..since the custom validator method is even been called out..which i dont want.
Please help.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top