473,467 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting the Names/Labels of form fields that are invalid.

I have a form that has validators for each field. When I submit the form, if
the field is invalid, it shows an error next to the field. Works perfectly.

I also have a label at the top of the form that, if page is NOT valid, will
display. This message says 'there is a problem with the form, please fix the
fields below'.

What I'd like to do is have that message also state which of the fields were
invalid.

I can use a summary validator for that, but that is rather cumbersom in
terms of layout, so I'd like to write out my own message/formatting. Is
there a way to 'get' values from fields that weren't valid?

I imagine I need to call a function, have that function check that validity
of each field, and then have that return a string?

-Darrel
Nov 18 '05 #1
1 1515
You can definitely build a custom control that looks through the validation
data. You have to build client-side and server-side support for it.
On the server side, the Page.Validators collection contains the validators.
Each has its own IsValid property that when false, indicates an error.
On the client-side, the Page_Validators array contains a list of HTML
elements (<span> tags) that are the actual validators. Look at the script
file \aspnet_client\system_web\[version]\WebUIValidation.js to study how to
use each element and detect that its valid.

I have built a replacement to Microsoft's validation system. It includes a
much more flexible ValidationSummary control with several new formatting
choices. If you drop me an email describing how you would like to format
your ValidationSummary, I can tell you if and how it works with my software.
("Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx)
--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have a form that has validators for each field. When I submit the form,
if
the field is invalid, it shows an error next to the field. Works
perfectly.

I also have a label at the top of the form that, if page is NOT valid,
will
display. This message says 'there is a problem with the form, please fix
the
fields below'.

What I'd like to do is have that message also state which of the fields
were
invalid.

I can use a summary validator for that, but that is rather cumbersom in
terms of layout, so I'd like to write out my own message/formatting. Is
there a way to 'get' values from fields that weren't valid?

I imagine I need to call a function, have that function check that
validity
of each field, and then have that return a string?

-Darrel

Nov 18 '05 #2

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

Similar topics

2
by: Martin O'Rourke | last post by:
All, I am hoping someone might be able to put me out of my misery and let me know if it is possible or not to dervie the name of an element in a form, based on its associated label, only knowing...
3
by: Tom | last post by:
Data is collected over time in an Excel worksheet with 20 columns. The Excel worksheet starts out as a copy of a template as is filled in as data is collected. Eventually the worksheet file is...
1
by: Steve | last post by:
I have looked through the newsgroup for an answer to this but haven't been able to find anything resembling my situation. What I want to do is relatively simple, I think. I have a crosstab...
6
by: Melissa | last post by:
I created a report that has labels in the top three inches of the page header. There's also an unbound subform there. When I go to preview or print, the records from the detail section overlap...
22
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
2
by: shadowman | last post by:
So here's the situation: I need to write a PHP script which accepts form submissions using all methods (GET and POST) and all content types (application/x-www-form-url-encoded and...
1
by: pluggy | last post by:
Hello, I am trying to display, on an MS Access form (frm024), the contents of a table (tbl_TypeOfOrgs). The table has two fields, OrgTypeID and OrgType. It currently has 4 records. This table...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.