in my login form ,i have two textbox one for username and the second one for password . both are watermark. the username watermark textbox is having textmode = text
the password textbox is having intially textmode=text but onfocus i want to change it to passwordmode
i dont want to use ajaxcontrols
i am using vb.net
i am using the java script function onfocus,onblur
.help me to convert the textmode of password textbox to password onfocus

7 Years
Discussion Span
Last Post by Ramesh S

When you set the TextMode to 'Password', actually the textbox is rendered as below

<input type="password" name="TextBox1">

If you set TextMode to 'SingleLine, the textbox is rendered as below

<input type="Text" name="TextBox1">

Both HTML INPUT controls are different.

Also the type property in the INPUT control is read only and cannot be changed using JavaScript.

But You can use two different TextBoxes, one for Text mode and another one for Password mode. And show and hide them using JavaScript.

See some sample code in the following link.

Changing an INPUT textbox's TYPE property on the fly

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.