Code

Updated gray out behaviour
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jul 2010 14:45:10 +0000 (14:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jul 2010 14:45:10 +0000 (14:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19173 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/users/password.tpl

index 7c5cc5b4770a56f3e8786c2692eb140d9703d194..2e9ad8223b3685297e915698d50195cbf8e61322 100644 (file)
   <table summary="{t}Password input dialog{/t}" cellpadding=4 border=0>
     <tr>
       <td>
-        <input type='radio' value='1' name='proposalSelected'
+        <input type='radio' value='1' name='proposalSelected' id='proposalSelected' onClick='updateFields();'
             {if $proposalSelected} checked {/if}>&nbsp;<b>{t}Use proposal{/t}</b>
       </td>
       <td>
-        <div style='
+        <div id='proposalText' style='
                   width:180px;
                   border:1px solid #BBB;
                   padding-top:3px;
@@ -52,7 +52,7 @@
     </tr>
     <tr>
       <td>
-        <input type='radio' value='0' name='proposalSelected'
+        <input type='radio' value='0' name='proposalSelected' onClick='updateFields();'
             {if !$proposalSelected} checked {/if}>&nbsp;<b>{t}Manually specify a password{/t}</b>
       </td>
     </tr>
   <input type=submit name="password_cancel" value="{msgPool type=cancelButton}">
   <input type='hidden' id='formSubmit'>
 </p>
-
-<!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-       nextfield= "new_password";
-       focus_field('new_password');
-  -->
+    nextfield= 'current_password';
+    focus_field('current_password');
+
+
+    function updateFields()
+    {
+        if($('proposalSelected').checked){
+            $('new_password').disable();
+            $('repeated_password').disable();
+            $('proposalText').setStyle(
+                 'background-color:#FFF;' +
+                 'color:#000;' +
+                 'width:180px;' +
+                 'border:1px solid #CCC;' +
+                 'padding:3px;' );
+        }else{
+            $('new_password').enable();
+            $('repeated_password').enable();
+            $('proposalText').setStyle(
+                 'background-color:#DDD;' +
+                 'color:#888;' +
+                 'width:180px;' +
+                 'border:1px solid #CCC;' +
+                 'padding:3px;');
+        }
+    }
+    updateFields();
 </script>
+
+
+