473,406 Members | 2,390 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,406 software developers and data experts.

Validator messages

I have a page that is very long so I have set it up to page using <div> to
display or hide the different pages. When I get to the last page the user
submits the page.

This works great, except that if one of the validators finds an error and it
isn't on the last page, the user won't see it. What I want to do is know
that there is an error on the 2nd page and make that page visible (which
would show the validator error message) and the user can make his changes.

Is there a way to know that a validator has fired and which one fired?

Thanks,

Tom
Nov 19 '05 #1
3 1276
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eG**************@TK2MSFTNGP15.phx.gbl...
I have a page that is very long so I have set it up to page using <div> to
display or hide the different pages. When I get to the last page the user
submits the page.

This works great, except that if one of the validators finds an error and
it isn't on the last page, the user won't see it. What I want to do is
know that there is an error on the 2nd page and make that page visible
(which would show the validator error message) and the user can make his
changes.

Is there a way to know that a validator has fired and which one fired?
I figured what I would do is to check all the validators and see if they
passed. Knowing what page the validator is on would allow me to make
visible the page that had the error.

The problem is that the "IsValid" doesn't seem to get set for the particular
validator, but the Page.IsValid does.

For example:

I have the following texbox and validator:

<asp:textbox id="ProfileName" columns="45" runat="server" />
<asp:RequiredFieldValidator
id="NameValidator"
ControlToValidate="ProfileName"
Display="Dynamic"
Text="Passport Name Required"
runat="server" />

I know that this validator is finding an error and setting the text to
display. It also sets the Page.IsValid correctly.

But when I run the following routine in the event that my submit button
calls, I get the NameValidator.IsValid showing as true and the Page.IsValid
showing as false.

Function CheckErrors() as Boolean
If NameValidator.IsValid then
trace.warn("NameValidator is true")
else
trace.warn("NameValidtor is false")
end if

if (Page.IsValid) then
trace.warn("Page Validator is true")
else
trace.warn("Page Validtor is false")
end if
end Function

Why is this?

Thanks,

Tom
Thanks,

Tom

Nov 19 '05 #2
Tom,

I might be misunderstanding you, so I will apologize in advance if
reading this post has wasted precious moments that you will be unable
to recover =). From my understanding, you have a very long page that
is separated by <div> tags. My first suggestion would be to make these
panel controls. You can perform the same functionality by making the
panels visible and invisible.

The benefit that you will get from this is that you will be able to put
separate validation summary controls in EACH panel. Thus if a user is
going through a wizard type application, they will not be able to
continue to the next "page" (panel), until all validators in that
panel are valid.

Does that make sense? Each page (panel), would contain the user input
fields, validators for the necessary fields, and a validation summary.
Once a user clicks the next button to move to the next page (panel),
the validation would trigger. If it is valid, the next page is
displayed...rinse and repeat.

I hope this helps!
Aaron

Nov 19 '05 #3
"Aaron Corcoran" <ac*******@lasers.state.la.us> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Tom,

I might be misunderstanding you, so I will apologize in advance if
reading this post has wasted precious moments that you will be unable
to recover =). From my understanding, you have a very long page that
is separated by <div> tags. My first suggestion would be to make these
panel controls. You can perform the same functionality by making the
panels visible and invisible.
Why would that be better than <div id="page1" visible="false"
runat="server">?

I was looking at some articles on the Web about using Panels, just as you
suggest, to break apart large pages into byte size pieces. They do the same
thing I do to display pages by setting the panel/div visible attribute to
true or false.

The benefit that you will get from this is that you will be able to put
separate validation summary controls in EACH panel. Thus if a user is
going through a wizard type application, they will not be able to
continue to the next "page" (panel), until all validators in that
panel are valid.
Do the validators work differently in Panels then Divs?

Does that make sense? Each page (panel), would contain the user input
fields, validators for the necessary fields, and a validation summary.
Once a user clicks the next button to move to the next page (panel),
the validation would trigger. If it is valid, the next page is
displayed...rinse and repeat.


Also, what about the Validators IsValid not showing as false when it fails
validation?

Thanks,

Tom
Nov 19 '05 #4

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

Similar topics

5
by: Alex M | last post by:
I'm trying to use the jakarta struts client side javascript validators and the validators are working, but they are not showing the popup messages. I have the message keys defined in the...
24
by: Nick Kew | last post by:
There's a new beta of the W3C Markup Validation Service now live at <URL:http://validator.w3.org:8001/> Probably the most important change is verbose output, including attempts to explain the...
195
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local...
4
by: Mary Ellen Curtin | last post by:
I made a web page (wheee!) and decided to test it (by upload) in the W3C Validator http://validator.w3.org/ I had some errors, but as Bilbo said of Gandalf, "The explanation did not explain." ...
8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
3
by: Angelos Karantzalis | last post by:
Hi guys, I've a small problem with validators. I'm building a single .aspx file that handles all my form posts. I need to be using ASP.NET validators ( or subclasses thereof ), so what i do to...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
0
by: Paul | last post by:
Hi all, I want to use the same wrapper table and header text for all validator error messages. The validator controls don't appear to supply an easy method for using tags and formatting. What...
37
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.