Asterix (*) on required fields

Posted on 2006-05-11
Medium Priority
Last Modified: 2008-02-01
Hi All,

Im hoping this is super easy.

I have some webforms (asp.net) which contain some required fields.  I check these with the following tag (example)

<asp:RequiredFieldValidator id="valRequired" runat="server"  Display="Static" ControlToValidate="proposer_surname"
                               ErrorMessage="Please Enter your Surname" >*</asp:RequiredFieldValidator>

Which is all great - and displays a lovely red asterix(*) when the fierld is blank.  However, I would like to mark these fields with a non-red asterix before the form is validated - to indicate they are required fields, and have the asterix turn red on validation failure.

I had assumed this is what the Display="static" property would do - but i now see this just reservrs space for the control (i had it set to dynamic previously).

So my question is there a simple way of doing this - or do i have to manualy code an asterix to appear on first load and disappear on post  backs?


Question by:peteSK
1 Comment
LVL 11

Accepted Solution

TornadoV earned 150 total points
ID: 16661216
I think it has to be done manually, I don't think there is a pre-built control for that.  I have an image that is simply located next to all required fields.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question