|
|
#1 (permalink) |
|
Surpass Fan
On a golden path...
Joined in Jul 2004
Hosted on Pass20
422 posts
Gave thanks: 1
Thanked 1 Time in 1 Post
|
convert from text to password
at the moment i have an ordinary textbox
<input type="text" name="n4" size="20"> i want a button and when they click it it turns the ordinary textbox into a password box <input type="password" name="n4" size="20"> and this button is gonna be labeled 'hide text'.....
__________________
:P |
|
|
|
|
|
#2 (permalink) |
|
says LEAVE BRITNEY ALONE!
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,091 posts
Gave thanks: 8
Thanked 34 times
|
is there a question here? i'm not seeing it. what you just typed out should be what you would do to make a password box, that's why i'm confused
__________________
|
|
|
|
|
|
#3 (permalink) |
|
the one who was
Super #1
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
|
I am not very certain that this can be done. The type specification for an input element is something that I don't think is possible to change after the page is loaded.
__________________
Patrick Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org |
|
|
|
|
|
#4 (permalink) |
|
says LEAVE BRITNEY ALONE!
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,091 posts
Gave thanks: 8
Thanked 34 times
|
I must not be understanding what you are trying to do. Unless, from what Patrick said, you want to make it load a normal box and turn that into a password box when they click the button? If this is correct, do you mind if I ask why you'd want to do this?
__________________
|
|
|
|
|
|
#5 (permalink) | |
|
after g, before i
Resident.
Joined in Jul 2004
Lives in N,BC,CA
8,079 posts
Gave thanks: 48
Thanked 131 times
|
Quote:
Could you possibly expand on what you're trying to accomplish? I'm more than willing to help you out, just need a little more to work with. |
|
|
|
|
|
|
#6 (permalink) |
|
Surpass Fan
On a golden path...
Joined in Jul 2004
372 posts
Gave thanks: 0
Thanked 0 times
|
there are css scripts which you can use, can't give a link now, but i've seen it done.
__________________
"I am one of the few honest people that I have ever known” ~~Nick, Great Gatsby --- Don't ever argue with idiots. They drag you down to their level and beat you with experience. |
|
|
|
|
|
#7 (permalink) |
|
Surpass Fan
Super #1
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
|
To my knowledge, that can not be done with CSS.
However, you could put some effort into writing a script. Something like this. Code:
<input type="text" id="text_input" value="" name="n4" /> <input type="hidden" id="hidden_input" value="" name="n5" /> <input type="button" value="Hide Text" onclick="hide_text" /> Code:
<script type="text/javascript">
function hide_text(){
var txt = document.getElementById('text_input');
var txt_value = txt.value;
var hidden = document.getElementById('hidden_input');
hidden.value = txt.value;
txt.value = '******';
/*Not sure how you would have the asterisks equal the
length of the input */
}
</script>
Please keep me in the loop if you get this to work out.
__________________
- Evan Charlton | [site] | Server - SH58 |
|
|
|
|
|
#8 (permalink) |
|
the one who was
Super #1
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
|
I don't think this last solution will work, since all you are basically doing is changing the value of the text field's entry to ***** (however many stars there may be). This will just cause stars to be posted to the form.
If there is a way to do this in javascript, I will find a new exploit. Field types are a very fundamental thing and changing them after they have been set is generally a no-no.Realistically, I think the original problem is more trouble than it is worth. I can see where changing a password box to a true password box after a user clicked a button, but in reality, whats the point? The only application I see for this is to let the user verify their new password visually, which seems silly at best. If you can't type the password correctly two times in a row, then you don't need it as a password. Maybe I am offbase here, but seems to me like this an idea designed to skirt the whole purpose of the password field. Masking input is a great thing IMHO.
__________________
Patrick Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org |
|
|
|
|
|
#9 (permalink) |
|
Surpass Fan
On a golden path...
Joined in Jul 2004
372 posts
Gave thanks: 0
Thanked 0 times
|
i saying using dhtml for this, isnt it possible? Its kinda like hiding the textbox, then clicking the image to switch it with a password box. I dont know DHTML, but i'm sure things like this are possible.I dont know, maybe i'm wrong....
__________________
"I am one of the few honest people that I have ever known” ~~Nick, Great Gatsby --- Don't ever argue with idiots. They drag you down to their level and beat you with experience. |
|
|
|