Forum Moderators: open
I am trying to be sneaky - I have a login page, on which I have username and password textboxes - which are really great now - since they display Username and Password in the boxes, but upon focus - this text disapears to allow them to enter their input uninterupted - the code for this is (for the password)
<INPUT id="password" onblur="javascript:if(this.value=='') {this.value='Password'}" style="BORDER-RIGHT: #d5d7ff 1px solid; BORDER-TOP: #d5d7ff 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #d5d7ff 1px solid; WIDTH: 135px; COLOR: black; BORDER-BOTTOM: #d5d7ff 1px solid; FONT-FAMILY: verdana; HEIGHT: 18px"
onfocus="javascript:if(this.value=='Password') {this.value='';}" type="text" size="15"
value="Password" name="box" runat="server">
So - works well and is all great - but I was thinking what would be ultra great is if, on focus - it could also change the attribute for type - from text input to password - which would cause the users input to be masked - but the original value "password" - to not be...
the problem arises from the fact that if the text box is set to password - of course any JS value assigned will also be masked - which more than a little spoils the effect!
Is this possible - can one capture the onfocus event for such a text box...?
sorry if this is a supid question!
Harley