If that worked, shouldn't this work?
<input type="text" onFocus="this.value='';thi
Main Topics
Browse All TopicsHello,
I have a page with login. Since to login field and password field is in small area, I cant add text in front, wich field is for password and wich for login name. So I want to have to innitial value of login field to be "Login name" and the initial value of password field "Password".
Then, when a user clicks on the field, the initial text disappears. I know how to change this for login field, but with password field i have a small problem. To show the initial value "Password" the input field has to be "text", but when I click on it, it has to change to "password" without the initial value.
Any idea how to do this?
Thanx in addvance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This works
<form>
<span id="pwTSpan"><input id="pwx" type="text"
onFocus="document.getEleme
document.getElementById('p
this.form.pw.focus()" value="password"><br></spa
<span id="pwSpan" style="display:none"><inpu
<input type="text" name="otherfield" value="other">
</form>
Hi,
The below code is working in firefox but not working in IE...
document.getElementById('p
So you create two password field. One type is text and the other type is password.. As default the text password filed is display.. After click in the input field, you must hide the text password field and show the type with password field..
Business Accounts
Answer for Membership
by: archang3lPosted on 2007-09-11 at 04:52:53ID: 19867672
Hello GuanoFun,
asswordbox ");
To change the input to a password box in JavaScript:
var element = document.getElementById("p
element.type = "password";
Regards,
archang3l