UBB.Dev
Posted By: khadgar change input type - 09/08/2004 6:18 PM
Hey there...

can anyone tell me if there is an option to do the following:



without using inner*HTML???
Posted By: Ian Spence Re: change input type - 09/08/2004 6:59 PM
why not just do ?
Posted By: khadgar Re: change input type - 09/08/2004 7:10 PM
I need to put in the value "Type password" and then when on*focus change the type to password, so I get the "dot" character instead of real characters. At the same time I clear the value.
Posted By: Ian Spence Re: change input type - 09/08/2004 8:18 PM
this could be done with some css, but I'd reccomend just having the text before the password box.

Besides, even with css you'd need javascript. I don't see what you'd use innerHTML for anyway, as this.value would achieve the same thing
Posted By: khadgar Re: change input type - 09/08/2004 9:37 PM
That's what I'm hoping for ... that CSS could do this ... but I don't know how ... the problem is taht I don't have enough space for writing it before the password box ... so if you have a solution I would be pleased :-)
Posted By: Ian Spence Re: change input type - 09/08/2004 10:24 PM
Code
<input style="background-image: url('/password.gif');"
type="text" onfocus="this.style.background-image='';" />
then have an image that says Password as the background.
Posted By: khadgar Re: change input type - 09/08/2004 11:11 PM
Nice! ... cool mate ...
didn't see that loophole ... thx!
© UBB.Developers