summaryrefslogtreecommitdiff
path: root/httemplate/elements/random_pass.html
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-07-06 11:52:22 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-08-18 10:59:30 -0400
commit862e1bf16a977784a73d6b0e413712830de408e6 (patch)
tree9a56e4a922de8e674dcaae6ed5a81e5604e78e32 /httemplate/elements/random_pass.html
parent77baa73413d756538cfb6f10dac71b60604f0184 (diff)
RT# 75817 - fixed contact password page to be more consistant with svc password page, updated javascript to check password as you type rather than when you leave the field.
Diffstat (limited to 'httemplate/elements/random_pass.html')
-rw-r--r--httemplate/elements/random_pass.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/httemplate/elements/random_pass.html b/httemplate/elements/random_pass.html
index 1517a55d7..778aa20e6 100644
--- a/httemplate/elements/random_pass.html
+++ b/httemplate/elements/random_pass.html
@@ -1,6 +1,6 @@
-<INPUT TYPE="button" VALUE="<% emt($label) %>" onclick="randomPass()">
+<INPUT TYPE="button" VALUE="<% emt($label) %>" onclick="<% $id %>randomPass()">
<SCRIPT TYPE="text/javascript">
-function randomPass() {
+function <% $id %>randomPass() {
var pw_set = <% $pw_set |js_string %>;
var lower = <% $lower |js_string %>;
var upper = <% $upper |js_string %>;
@@ -19,11 +19,15 @@ function randomPass() {
for(var j, x, i = pass.length; i; j = Math.floor(Math.random() * i), x = pass[--i], pass[i] = pass[j], pass[j] = x);
pass = pass.join('');
document.getElementById('<% $id %>').value = pass;
+% if ($submitid) {
+ document.getElementById('<% $submitid %>').disabled = false;
+% }
}
</SCRIPT>
<%init>
my $id = shift;
my $label = shift || 'Generate';
+my $submitid = shift;
my $pw_set = join('', FS::Password_Mixin->pw_set);
my $lower = join('', $pw_set =~ /[[:lower:]]/g);
my $upper = join('', $pw_set =~ /[[:upper:]]/g);