Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you change a textbox to a password box with Javascript?

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I've got a textbox in a form with the initial value acting as the description for that field. When a user clicks on the box, the description disappears, thus leaving an empty space for input. So far, so good:


However its a password entry and I would like it to display &quot;*****&quot; once that initial descriptive text has gone. I think this means changing the code from <input type = &quot;text&quot;> to <input type = &quot;password&quot;> . Can this be done with Javascript once someone clicks in the textbox, as at the moment I'm drawing a blank?
 
i don't know if you can change the type of an input.

but how about having a regular textbox and an invisible password textbox.

the regular textbox would contain your description and when clicked, the visibilities swap so your user is left with a password box?

ss
 
hie
i dont think it is possible, why wont u just do it like this?

password: <input type=password ..
everybody doin this.. Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top