jQuery default/placeholder input text and problems with saved information
- by user318106
Hey Guys,
I'm new to jQuery and have an annoying problem.
I have some login fields that are filled with default text when the field is empty and then removed when clicked.
My problem is that when the user has their username/password saved (with browser), if they return to the page the login fields are filled with the users saved input as well as the default input.
$('#login input.text').each(function(i, field) {
field = $(field);
if (field.val().length 0) {
field.prev().css('display', 'none');
}
field.focus(function() {
field.prev().css('display', 'none');
}).blur(function() {
if (field.val() == '') field.prev().css('display', 'block');
});
})