473,775 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validation - indicate invalid field

Hi,

How do I indicate what field fails a validation, usually you see a red star
next to the faild field on a form. Is this built in functionality in the
valdaition controls or shall I code this myself ?

Niclas
Apr 2 '06 #1
1 1834
Use the Text property of the validator and set the display to dynamic, e.g.
<asp:RequiredFi eldValidator ID="valTextBox1 " runat="server"
ErrorMessage="Y ou have to enter a text"
ControlToValida te="txtBox1" Text="*" Display="dynami c">
</asp:RequiredFie ldValidator>

This will show a red "*" when the user tabs off the textbox without entring
any value.

The ErrorMessage property will then display the detailed message if you have
a ValidationSumma ry control defined on the form.

http://msdn.microsoft.com/library/de...ssagetopic.asp
A quote from the above link:

"Use the ErrorMessage property to specify the text to display in the
validation control when validation fails. This text is also included in the
ValidationSumma ry control, if one is placed on the Web page.

It is possible to display different text for the validation control and the
ValidationSumma ry control. Use the Text property to specify the text to
display in the validation control.

Note If the Text property is set, that text will override the text
specified in the ErrorMessage property and appear in the validation control.
However, the text specified by the ErrorMessage property always appears in
the ValidationSumma ry control."

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Niclas" wrote:
Hi,

How do I indicate what field fails a validation, usually you see a red star
next to the faild field on a form. Is this built in functionality in the
valdaition controls or shall I code this myself ?

Niclas

Apr 2 '06 #2

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

Similar topics

21
3921
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email adresses and so on. I thought it might be a better way to programm an automated, dynamic form validation that works for all kinds of fields, shows the necessary error messages and highlights the coresponding form fields.
5
2610
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce validation on both. Is there a way to link the drop-down choice to the correspondent validation section while disabling validation for the other one? here's what I presently have:
6
5034
by: tm | last post by:
I am trying to reference a table entry (qtyonhand) populated from a recordset. There is only one record displayed on this table. When i try to compare this displayed field to an input field (orderqty) i get an (error on this page or no result at all ). When just comparing the input field to a set of "" everything works fine. This is an ASP file with a javascript function. Thanks in advance. Signed... New at this! code below...
14
3413
by: Daron | last post by:
I am doing so data validation, and need to check if a filed contains a valid date in the format of "YYYY-MM-DD" I would like to know if it is possible to convert this series of If's to a Select Case. I am having trouble incorporating the various functions (len(), isdate(). The IF's work, but I know this could be better and more flexible. Any suggestions would be greatly appreciated. : '-------------------------------- If...
0
1112
by: John Harcourt | last post by:
When I run the XML Validation against a schema using the XMLValidatingReader (.NET 1.1), the error messages that are produced are pretty generic. If I have an element name "LastName", and the schema specifies that it can only be 20 characters long, the Validator will create the error: "The 'LastName' element has an invalid value according to its data type. An error occurred at , (1, 148)." (Because I'm building the Xml file in...
7
6999
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form is correct I need to submit to another page that uses the form data. I first tried making the form submit action= field point to the same file. When the form was correct, I tried loading the next page by using <META http-equiv refresh>. But...
7
3620
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
8
2738
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
18
6234
by: ChipR | last post by:
I have a text box with a validation rule and validation text. When entering a new record, if I put in invalid text, the validation text is displayed in a message box, but after clicking OK, another message box is displayed with: ----------- myApplication (i bubble icon) The value violates the validation rule for the field or record. For example, you might have changed a validation rule without verifying whether the existing data matches...
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10270
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10109
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9916
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7464
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5360
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.