% if (!$opt{'no_label_display'}) {
<A ID="<%$pre%>link" HREF="javascript:void(0)" onclick="<%$pre%>toggle(true)">(<% emt( $change_title ) %>)</A>
% }
-<DIV ID="<%$pre%>form" CLASS="passwordbox">
+<DIV ID="<%$pre%>div" CLASS="passwordbox">
% if (!$opt{'noformtag'}) {
- <FORM METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html">
+ <FORM ID="<%$pre%>form" METHOD="POST" ACTION="<%$fsurl%>misc/process/change-password.html" onsubmit="return <%$pre%>checkPasswordValidation()">
% }
<% $change_id_input %>
'contactnum' => $opt{'contact_num'},
'submitid' => $change_button_id,
&>
-% if ( $error ) {
- <BR><SPAN STYLE="color: #ff0000"><% $error |h %></SPAN>
-% }
% if (!$opt{'noformtag'}) {
</FORM>
if (clear) {
document.getElementById('<%$pre%>password').value = '';
document.getElementById('<%$pre%>password_result').innerHTML = '';
-% if ($opt{'contact_num'}) {
- document.getElementById('<% $opt{'pre_pwd_field_label'} %>selfservice_access').value = 'Y';
-% }
-}
- document.getElementById('<%$pre%>form').style.display =
+ document.getElementById('<%$change_button_id%>').disabled = true;
+ }
+ document.getElementById('<%$pre%>div').style.display =
toggle ? 'inline-block' : 'none';
% if (!$opt{'no_label_display'}) {
document.getElementById('<%$pre%>link').style.display =
toggle ? 'none' : 'inline';
% }
}
+
+function <%$pre%>checkPasswordValidation(resultId) {
+ var validationResult = document.getElementById('<%$pre%>password_result').innerHTML;
+ if (validationResult.match(/Password valid!/)) {
+ return true;
+ }
+ else {
+ return false;
+ }
+}
</SCRIPT>
<%init>
my %opt = @_;
}
elsif ($opt{'contact_num'}) {
$change_id_input = '
- <INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'contactnum" VALUE="' . $opt{'contact_num'} . '">
- <INPUT TYPE="hidden" NAME="'.$opt{'pre_pwd_field_label'}.'custnum" VALUE="' . $opt{'custnum'} . '">
+ <INPUT TYPE="hidden" NAME="contactnum" VALUE="' . $opt{'contact_num'} . '">
+ <INPUT TYPE="hidden" NAME="custnum" VALUE="' . $opt{'custnum'} . '">
';
$pre .= $opt{'pre_pwd_field_label'};
}