469,898 Members | 1,547 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Form field error messages

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?

Jul 21 '05 #1
3 1781
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/quickst...alidation.aspx

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

http://www.devhood.com/tutorials/tut...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" <bl******@hotmail.com> wrote in message
news:LJ********************@adelphia.com...
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 state d?

Jul 21 '05 #2
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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


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.
Jul 21 '05 #3
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" <bl******@hotmail.com> wrote in message
news:lK********************@adelphia.com...
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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
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.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by TekWiz | last post: by
8 posts views Thread by dmcconkey | last post: by
18 posts views Thread by Stephanie | last post: by
3 posts views Thread by Shabam | last post: by
9 posts views Thread by julie.siebel | last post: by
11 posts views Thread by Rik | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.