louiseturkey
New Member
I have to add a default grey text in a text field of an ASP.net page like this
And when User click/Enter in a field, the default text disappear.Now how to perform this in txtbox event?I manage to implement onFocus event for changeing text color; In my ASPX page, I create an tag for JS Code:JS Code\[code\]<script type="text/javascript"> function test(obj) { obj.style.color = "grey"; }</script>\[/code\]My VB Code\[code\] txtBox.Attributes.Add("OnFocus", "test(this)")'txtBox is the ID of text Box\[/code\]Now that embarrassing asking very basic question about JavaScript OnFocus event.But "Question is a key of knowledge" Edit: I must not use any HTML tag in my ASP.Net PageAny help? Thanks