You must Sign In to post a response.

Put an asterisk(*)in red color beside a textbox control

Hi,

I want to put an asterisk(*)in red color beside a textbox control which is mandatory field in a webpage.Can u please tell me how to do that. I will appreciate your help.

Thanks


Comments

Author: Rajapandian13 Mar 2009 Member Level: Gold   Points : 2

Hi,

In aspx page before that textbox add below line.

*

Author: Shreekumar13 Mar 2009 Member Level: Gold   Points : 2

Here's the code for .aspx file


< asp:TextBox ID="YourId" runat="server" > < /asp:TextBox >
< span style="color: red" > * < /span >

Author: Mrs. Meetu Choudhary Nanda13 Mar 2009 Member Level: Gold   Points : 2

use the span tag where ever you want to put the red * like

< span style="color: red" > * < /span >

Author: Babu Akkandi14 Mar 2009 Member Level: Gold   Points : 2

Hi,

this is another way to implement,

place Requirefield validator control next to the each Textbox which are all mantatory,

set following property in Requirefield validator control, thru property window(F4)

errormessage = "*"
controltovalidate = textboxname

when you submit the value, if the value is missed in the text box, then it will display "*" in red color, as you expects.

Hope it Helps!

Note: Plz rate this answer, if it helped you!!


Sign In to post your comments