Is there a way to add a checkbox or radio buttons on a page to toggle form fields between input type "text" and "password"?
The reason I put jQuery in subject line because I'm trying to use it exclusively and I have a lot of confidence in its potential. :)
Thanks.
UPDATE: I need to toggle because I need the user an ability to come back and review previously entered input. (Tip: This is not a login script.)
I ended up simplifying this into the following solution:
$('input#checkbox').change(function(){
var type = ($(this).is(':checked') ? 'text' : 'password'),
input = $('input#password'),
replace = input.clone().attr('type', type)
input.replaceWith(replace);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With