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

#355750    Author: Rajapandian    13 Mar 2009 Member Level: Gold   Points : 2

Hi,

In aspx page before that textbox add below line.

<em id="mandatory" style="color:Red">*</em>


Regards,
Rajapandian

#355752    Author: Shreekumar    13 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 >

Shreekumar. S. S
Hobby web developer

Specialized in ASP.Net 2.0, SQL Server 2000, C#, AJAX

#355759    Author: Mrs. Meetu Choudhary Nanda    13 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 >


Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green

#355766    Author: Babu Akkandi    14 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!!


Thanks and Regards,
Babu Akkandi


This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.