RT# 75817 - updated set contact password to use popup window. fixes break in first...
[freeside.git] / httemplate / elements / change_password.html
index b3a432f..a8cc883 100644 (file)
     <INPUT TYPE="text" ID="<%$pre%>password" NAME="password" VALUE="<% $curr_value |h%>">
     <& /elements/random_pass.html, $pre.'password', 'randomize' &>
     <INPUT TYPE="submit" VALUE="change">
-    <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">
+% if ($opt{'popup'}) {
+    <INPUT TYPE="button" VALUE="cancel" onclick="parent.cClick();">
+% }
+% else {
+    <INPUT TYPE="button" VALUE="cancel" onclick="<%$pre%>toggle(false)">  
+%}
     <DIV ID="<%$pre%>password_result" STYLE="font-size: smaller"></DIV>
     <& '/elements/validate_password.html', 
          'fieldid'    => $pre.'password',
@@ -34,7 +39,7 @@ function <%$pre%>toggle(val) {
   document.getElementById('<%$pre%>link').style.display =
     val ? 'none' : 'inline';
 }
-% if ( $error ) {
+% if ( $error || $opt{'popup'} ) {
 <%$pre%>toggle(true);
 % }
 </SCRIPT>
@@ -63,5 +68,9 @@ elsif ($opt{'contact_num'}) {
   $pre .= $opt{'contact_num'} . '_';
 }
 
+if ($opt{'popup'}) {
+  $change_id_input .= '<INPUT TYPE="hidden" NAME="popup" VALUE="' . $opt{'popup'} . '">';
+}
+
  my $error = $cgi->param($pre.'error');
 </%init>