asp.net - ASPX Password textbox -


by default, password fieldbox masked text user typed **.

i want able display string on password field box.

so should says "please enter password" when password control loaded.

currently aspx showing *******

how can best achieve this?

cheers

you can achieve using jquery:

html:

<input id="password" value="password" class="password-input" /> 

js:

$('.password-input').bind('click', function() {     if ($(this).val() === "please enter password")     {        this.type = "password";        $(this).val('');      } });  $('.password-input').bind('blur', function() {     if ($(this).val() === "")     {        this.type = "text";        $(this).val('please enter password');     } }); 

jsfiddle:

http://jsfiddle.net/v2dh5/3/

you can see previous questions same thing:

set default value of password input can read

set default value of password input / scenario / issue in ie 8

default value asp.net textbox -> textmode = password


Comments