Code

Added <LABEL> tags to password proposal selection
[gosa.git] / gosa-core / plugins / admin / users / password.tpl
index 9a99154dcfe1e37aeb6e85383784c1996baf3d2a..2674ee0f916cd099b92cba3e564a2286360f2713 100644 (file)
   <table summary="{t}Password input dialog{/t}" cellpadding=4 border=0>
     <tr>
       <td>
-        <input type='radio' value='1' name='proposalSelected'
-            {if $proposalSelected} checked {/if}>&nbsp;<b>{t}Use proposal{/t}</b>
+        <input type='radio' value='1' name='proposalSelected' id='proposalSelected_true' onClick='updateFields();'
+            {if $proposalSelected} checked {/if}>&nbsp;<b><LABEL for="proposalSelected_true">{t}Use proposal{/t}</LABEL></b>
       </td>
       <td>
-        <input type='text' disabled value="{$proposal}" style='color: black;'>
-        &nbsp;{image path='images/lists/reload.png' action='refreshProposal'}
+        <div id='proposalText' style='
+                  width:180px;
+                  border:1px solid #CCC;
+                  padding:3px;
+                  padding-top:5px;
+                  padding-bottom:4px;
+            '>{$proposal}</div>
+      </td>
+      <td style='vertical-align: middle;'>
+            {image path='images/lists/reload.png' action='refreshProposal'}
       </td>
     </tr>
     <tr>
       <td>
-        <input type='radio' value='0' name='proposalSelected'
-            {if !$proposalSelected} checked {/if}>&nbsp;<b>{t}Manually specify a password{/t}</b>
+        <input type='radio' value='0' name='proposalSelected' id='proposalSelected_false' onClick='updateFields();'
+            {if !$proposalSelected} checked {/if}>&nbsp;<b><LABEL for="proposalSelected_false">{t}Manually specify a password{/t}</LABEL></b>
       </td>
     </tr>
     <tr>
 
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
        nextfield= "new_password";
        focus_field('new_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;' +
+                 'padding-top:5px;' +
+                 'padding-bottom:4px;');
+        }else{
+            $('new_password').enable();
+            $('repeated_password').enable();
+            $('proposalText').setStyle(
+                 'background-color:#F0F0F0;' +
+                 'color:#666;' +
+                 'width:180px;' +
+                 'border:1px solid #CCC;' +
+                 'padding:3px;' +
+                 'padding-top:5px;' +
+                 'padding-bottom:4px;');
+        }
+    }
+    updateFields();
 </script>
+
+