|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, id like to change the type of a text field into a password field.
the thing is, the field should first say 'password' and as soon as the user clicks the field it should clear and change to a password field so the typed word is in *s. any ideas? Thanks, Bas |
|
#2
|
|||
|
|||
|
You would think this would work.
<form name="myForm"> <input type="text" name="user" value="username" /><br /> <input onFocus="javascript: this.type = 'password'; this.value = '';" type="text" value="Password" name="pass" /> </form> but since the type element is read only you can not do it that way...so you'll need to create a function that will destroy the form element 'pass' and write a new one. At least that is how my thinking is leading me. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > changing input type from text to password on the fly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|