Add clear form button for "Add new password" div
This commit is contained in:
parent
76c7797ee2
commit
d2fe770463
|
@ -167,6 +167,7 @@ if ($user != "")
|
||||||
echo "<input type=\"button\" name=\"add\" value=\"Add\" onclick=\"add_password();\"/>";
|
echo "<input type=\"button\" name=\"add\" value=\"Add\" onclick=\"add_password();\"/>";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo '<div><a href="http://en.wikipedia.org/wiki/Password_strength">Master key strength</a><div id="scorebarBorder"><div id="score">0%</div><div id="scorebar"> </div></div></div>';
|
echo '<div><a href="http://en.wikipedia.org/wiki/Password_strength">Master key strength</a><div id="scorebarBorder"><div id="score">0%</div><div id="scorebar"> </div></div></div>';
|
||||||
|
echo "<input type=\"button\" name=\"clear\" value=\"Clear Form\" onclick=\"clear_form();\"/>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -109,6 +109,21 @@ function generate_simple_password()
|
||||||
document.getElementById("new_password").value = _generate_random(8, symbols);
|
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) {
|
function url_domain(data) {
|
||||||
var uri = parseUri(data)
|
var uri = parseUri(data)
|
||||||
return uri['host'];
|
return uri['host'];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user