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




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com