diff options
author | Christopher Burger <burgerc@freeside.biz> | 2017-07-06 11:52:22 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2017-07-06 11:52:22 -0400 |
commit | 59776b97e0d82e30e9a50c76d16f302309fff76d (patch) | |
tree | 40312c609a9e1ff36d759d503ef0948c7e7a3d31 /httemplate/elements/random_pass.html | |
parent | 53427a0d7b74c16d646196e70c95971471e1fae8 (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.html | 8 |
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); |