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

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?

Nov 18 '05 #1
3 1349
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?

Nov 18 '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.
Nov 18 '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.

Nov 18 '05 #4

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

Similar topics

3
by: TekWiz | last post by:
I've got a system that automatically generates a form. I have it set up so that the backend will return to the inital form page with an error object in sessions data (assuming the backend detected...
8
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation,...
18
by: Stephanie | last post by:
I tried to create an email/contact form but i'am stuck. (i'am a php-newbie) Let me explain (sorry for my bad english, it's not my native language) I have a form with the required fields and the...
3
by: Shabam | last post by:
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...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.