473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Checking if the page IsValid in Javascript?!

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
Nov 18 '05 #1
4 18638
Hi,

client-side script has also Page_IsValid flag to indicate the status of the
validation. See this article for details:
http://msdn.microsoft.com/library/de...pplusvalid.asp

Basically the cient-side checking you need to develop yourself but the tools
you need exist in the client-side validation API

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:ur****************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2
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
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:Oi****************@TK2MSFTNGP12.phx.gbl...
Hi,

client-side script has also Page_IsValid flag to indicate the status of the validation. See this article for details:
http://msdn.microsoft.com/library/de...pplusvalid.asp
Basically the cient-side checking you need to develop yourself but the tools you need exist in the client-side validation API

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:ur****************@TK2MSFTNGP09.phx.gbl...
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


Nov 18 '05 #3
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.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
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
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:Oi****************@TK2MSFTNGP12.phx.gbl...
Hi,

client-side script has also Page_IsValid flag to indicate the status of

the
validation. See this article for details:

http://msdn.microsoft.com/library/de...pplusvalid.asp

Basically the cient-side checking you need to develop yourself but the

tools
you need exist in the client-side validation API

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:ur****************@TK2MSFTNGP09.phx.gbl...
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



Nov 18 '05 #4
Thanks Teemu,

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

Thanks again

Emilio
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
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
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:Oi****************@TK2MSFTNGP12.phx.gbl...
Hi,

client-side script has also Page_IsValid flag to indicate the status of the
validation. See this article for details:

http://msdn.microsoft.com/library/de...pplusvalid.asp
Basically the cient-side checking you need to develop yourself but the

tools
you need exist in the client-side validation API

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:ur****************@TK2MSFTNGP09.phx.gbl...
> 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
>
>



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthias Lohrer | last post by:
Hi, I'm playing around with the possibilities of Page.ParseControl. I parse a string with an input-field and an RequiredFieldValidator-control. For testing the server-side validation I disable...
4
by: R.A. | last post by:
Hi If I use the client side validation control, do I need to check for IsValid on the server side? if yes then why? Thanks
5
by: Jim Heavey | last post by:
When should you use the Page.Validate() method? I thought you would use this method if you have some Server side validation (CustomControl's) you wanted to use and this would cause them to be...
1
by: Liz | last post by:
I have a page with several dropdownlists, several text boxes and several buttons which perform calculations. I need to validate one dropdownlist (not the whole page) with the click of one button. I...
1
by: gryffin | last post by:
im trying to do file extension checking but its not working :( i have the following in the head <script language="JavaScript"> extArray = new Array(".jpg", ".png", ".bmp"); function...
6
by: Mike Chen | last post by:
We know in server code, we can check the page validated by using Page.IsValid where we put some validator controls on aspx page. I want to set some value after validating user input values on...
3
by: Andrew Jocelyn | last post by:
Hi I have couple of dropdown controls each with a requiredfieldvalidator. I clear the dropdownlist in the button click event. When the page is rendered the dropdown validator already flags it's...
4
by: Andy B | last post by:
How do you add javascript to a page from codebehind? I have a method I am working on that has a few conditions in it: 1. if either 1 or both WordTextBox or DefinitionTextBox is empty, show a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.