projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 75817 - fixed contact password page to be more consistant with svc password page...
[freeside.git]
/
httemplate
/
elements
/
validate_password.html
diff --git
a/httemplate/elements/validate_password.html
b/httemplate/elements/validate_password.html
index
fd2cb6c
..
3d23a55
100644
(file)
--- a/
httemplate/elements/validate_password.html
+++ b/
httemplate/elements/validate_password.html
@@
-20,25
+20,30
@@
should be the input id plus '_result'.
'method' => 'POST', # important not to put passwords in url
&>
<SCRIPT>
'method' => 'POST', # important not to put passwords in url
&>
<SCRIPT>
-function add_password_validation (fieldid) {
+function add_password_validation (fieldid
, submitid
) {
var inputfield = document.getElementById(fieldid);
var inputfield = document.getElementById(fieldid);
- inputfield.on
change
= function () {
+ inputfield.on
keyup
= function () {
var fieldid = this.id+'_result';
var resultfield = document.getElementById(fieldid);
if (this.value) {
resultfield.innerHTML = '<SPAN STYLE="color: blue;">Validating password...</SPAN>';
var fieldid = this.id+'_result';
var resultfield = document.getElementById(fieldid);
if (this.value) {
resultfield.innerHTML = '<SPAN STYLE="color: blue;">Validating password...</SPAN>';
- validate_password('fieldid',fieldid,'svcnum','<% $opt{'svcnum'} %>','password',this.value,
+ validate_password('fieldid',fieldid,'svcnum','<% $opt{'svcnum'} %>','
contactnum','<% $opt{'contactnum'} %>','
password',this.value,
function (result) {
result = JSON.parse(result);
var resultfield = document.getElementById(result.fieldid);
if (resultfield) {
function (result) {
result = JSON.parse(result);
var resultfield = document.getElementById(result.fieldid);
if (resultfield) {
+ var errorimg = '<IMG SRC="<% $p %>images/error.png" style="width: 1em; display: inline-block; padding-right: .5em">';
+ var validimg = '<IMG SRC="<% $p %>images/tick.png" style="width: 1em; display: inline-block; padding-right: .5em">';
if (result.valid) {
if (result.valid) {
- resultfield.innerHTML = '<SPAN STYLE="color: green;">Password valid!</SPAN>';
+ resultfield.innerHTML = validimg+'<SPAN STYLE="color: green;">Password valid!</SPAN>';
+ if (submitid){ document.getElementById(submitid).disabled = false; }
} else if (result.error) {
} else if (result.error) {
- resultfield.innerHTML = '<SPAN STYLE="color: red;">'+result.error+'</SPAN>';
+ resultfield.innerHTML = errorimg+'<SPAN STYLE="color: red;">'+result.error+'</SPAN>';
+ if (submitid){ document.getElementById(submitid).disabled = true; }
} else {
result.syserror = result.syserror || 'Server error';
} else {
result.syserror = result.syserror || 'Server error';
- resultfield.innerHTML = '<SPAN STYLE="color: red;">'+result.syserror+'</SPAN>';
+ resultfield.innerHTML = errorimg+'<SPAN STYLE="color: red;">'+result.syserror+'</SPAN>';
+ if (submitid){ document.getElementById(submitid).disabled = true; }
}
}
}
}
}
}
@@
-48,7
+53,8
@@
function add_password_validation (fieldid) {
}
};
}
}
};
}
-add_password_validation('<% $opt{'fieldid'} %>');
+
+add_password_validation('<% $opt{'fieldid'} %>', '<% $opt{'submitid'} %>');
</SCRIPT>
<%init>
</SCRIPT>
<%init>