I want to clear the password text field each time the pop-up is shown. The pop-up contains the password field
I'm using below function in jquery to reset:
function resetPopupFormErrors() {
$("div.errors").closest("tr").remove();
....
}
And I'm calling this function in fancybox on startup. How can I reset the password text in above function so that if the user has typed something in text field & closed the pop-up & then if user opens it again, I don't want that password to reappear....How can I do it using jquery in above function?
EDIT: If I look at the html view source after typing the password, the value is empty for that password field. How can we clear something that's not appearing in value field? Thanks!
Why not just set the textbox's value to ''
?
$('input[type="password"]').val('');
Note that this resets all password textboxes. Use an id
if you want to target a specific one.
Wouldnt you do it the same as clearing a normal text box?
$("#yourTextBox").val('');
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