asp.net - How to have default text for textbox and making it fade away only when user types something -


i having asp.net textboxes contact form.how can have default text textbox , make text fade away when user types , not on focus , search box example.i think different textbox watermark.any suggestions welcome , thanks.

this doesn't answer question, rectifies part of question.

just search box example

the search box uses html 5 placeholder attribute, , functionality you're seeing chrome specific.

user agents should present hint user, after having stripped line breaks it, when element's value empty string and/or control not focused (e.g. displaying inside blank unfocused control , hiding otherwise).

the bold part states functionality should remove placeholder text if value empty and/or it's not focused.

chrome has decided implement 'when it's not empty, remove placeholder' if textbox focused , empty, placeholder remains.

other browsers (ie/firefox/opera) remove placeholder on focus.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -