Salut,
J'ai une liste de selection et un checkbox. Je veux que suivant l'element séléctionné dans ma liste, l'etat du carré checkbox change, il sera soit grisé( donc l'utilisateur ne pourra pas le séléctuionner soit blanc donc l'utilisateur pourra dans ca cas le selectionner).
voici le code :
liste de séléction :
<td style="width: 140px; height: 30px;" class="br bb"><html:select style="width:100px; border: 1px solid #000000;"property="dealType" onchange="enableFields(askPrice, validDate);displayOrderBuyPrice(1);refreshLimitLowPerf(askPrice, textPerf);manageUnderCondition();" ><html:options name="orderTypeSelectBean" labelName="orderTypeSelectBean" property="selectKeys" labelProperty="selectLabels" /></html:select></td>
mon checkbox :
1 2 3
| <td valign="middle">
<html:checkbox property="checkboxUnder" style=" border: 1px solid #000000;background-color:#C0C0C0" onclick="switchDisplay('1');" />
</td> |
et mon sxitchdisplay :
1 2 3 4 5 6 7 8 9
| function switchDisplay(id){
if(document.getElementById("t"+id).style.display=='none'){
document.getElementById("t"+id).style.display='';
}
else
{
document.getElementById("t"+id).style.display='none';
}
} |
Je ne sais pas comment procéder, merci de bien m'aider.
Partager