Asterix (*) on required fields

Hi All,

Im hoping this is super easy.

I have some webforms ( 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?


Who is Participating?
TornadoVConnect With a Mentor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.