.NETGURU
Form field error messages
Messages   Related Types
This message was discovered on microsoft.public.dotnet.scripting.

Post a new message to this list...

Shabam
I know that dotnet allows for form field validation. However I'm looking to
customize the error message display and am wondering if it's possible to do
what I need.

Example:

Suppose in a form there is a "Name" field (required). The user leaves it
blank and submits the form. I need to reload the page with the "Name" in
red so the user can see which field(s) have errors in them.

Second, at the top of the page I need a table displaying a descriptive error
message. That table would be customized of course.

I've been told that dotnet does the error output dynamically via client end
script, then server end script if user has turned off javascript. I was
also told that dotnet has limitations in terms of customizing it the way
I've described.

Is this true? If not how does one go about customizing it like I've stated?

Reply to this message...
 
    
Hermit Dave
you have validation controls that you can use in asp.net.
if you have vs.net... you will find them in the toolbox where you can drop
them on to aspx in the designer.

RequiredFieldValidator does what it says... if you assign a control to it...
the user has to populate the control.. like a text box and only then it will
allow form submission.
you have other validation controls like RangeValidation Regular Expressions
Validator etc. you can specify what you want...

you have validation summary control that automatically does a list of error
messages from validation controls.

you can customise error messages and even write your own validations. have a
look at the links

http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx

http://www.codeproject.com/useritems/ValidatorCtrl_by_VIVEK.asp

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=46

http://www.4guysfromrolla.com/webtech/090200-1.shtml

http://www.15seconds.com/issue/030211.htm

HTH
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Shabam" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> I know that dotnet allows for form field validation. However I'm looking
to
> customize the error message display and am wondering if it's possible to
do
[Original message clipped]

Reply to this message...
 
    
Shabam
"Hermit Dave" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Thanks for the input. I understand there are server validation controls in
vs.net. However I need to customize them to my needs. As I understand it,
error messages appear after the control. I would like to just change the
font color of the heading to red. Also, at the top of the page, I need to
print out the exact errors, but surround the messages with my custom table
and graphic. How do I go about doing such? Thanks.

Reply to this message...
 
    
Hermit Dave
The validation controls have two properties.. one is Error Message and the
other one is Text
If you populate both and have a Summary Control then...
the Text is display next on the validation control
the Error message is displayed in the summary control.

if you want the error message in Red.. then just set the Validation /
Summary Control's CssClass to the right style.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Shabam" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Web.UI.MobileControls.RequiredFieldValidator
System.Web.UI.WebControls.RequiredFieldValidator




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification