Add clear form button for "Add new password" div

This commit is contained in:
Gregory Soutade
2020-08-16 15:29:56 +02:00
parent 5b9640e8cb
commit 4271551fed
2 changed files with 16 additions and 0 deletions

View File

@@ -109,6 +109,21 @@ function generate_simple_password()
document.getElementById("new_password").value = _generate_random(8, symbols);
}
function clear_form()
{
div = document.getElementById("add_new_password");
inputs = div.getElementsByTagName("input");
for(i=0; i<inputs.length; i++)
{
if (inputs[i].type == "text" ||
inputs[i].type == "password")
inputs[i].value = "";
}
chkPass("");
}
function url_domain(data) {
var uri = parseUri(data)
return uri['host'];