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:
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
Comments
Post a Comment