Hi,

I think a radiobutton would could be the better choice:

<tr>
    <td class="color"><bean:message
key="systemadminconsol.createuser.admin"/>&nbsp; </td>
     <td>
     <html:radio  name="AddUserForm" property="modus" value="admin"
tabindex="20" /> 
     </td>
   </tr>

<tr>
    <td class="color"><bean:message
key="systemadminconsol.createuser.lead"/>&nbsp; </td>
     <td>                     
     <html:radio name="AddUserForm" property="modus" value="lead"
tabindex="20" /> 
     </td>
 </tr>

When Form is subbmitted, the propery "modus" holds either "admin" or "lead".

Kind regards

Ole

-----Ursprüngliche Nachricht-----
Von: senthil Kumar [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 9. März 2005 12:22
An: Struts Users Mailing List
Betreff: Validation required in Checkbox

Hello all.,

I have a Two Box called admin and lead.

Admin is checked mean lead disabled. admin value is "Y" and  lead value is
"N"
When admin is unchecked mean lead should Enabled and vice versa also.

I put my code for your reference, if any one changed and give the idea to
me.


Thankd in advance.



regs.,
Senthil S

  <tr>
    <td class="color"><bean:message
key="systemadminconsol.createuser.admin"/>&nbsp; </td>
     <td>
     <html:checkbox  name="AddUserForm" property="isAdmin" value="admin"
onclick="adminChecked(this)" tabindex="20" /> 
     </td>
   </tr>

<tr>
    <td class="color"><bean:message
key="systemadminconsol.createuser.lead"/>&nbsp; </td>
     <td>                     
     <html:checkbox name="AddUserForm" property="isLead" value="lead"
onclick="leadChecked(this)" tabindex="20" /> 
     </td>
 </tr>

  

function adminChecked(obj){     
  if (!obj.checked)
  document.forms[0].isAdmin.value = "N";
  else
  document.forms[0].isAdmin.value = "Y";
  document.forms[0].isLead.disabled ="true";
   }


"leadChecked(this)" this is also vice versa of above method.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to