voici un code permettant de jouer entre deux bouton radios.
=======================================
<td>
<oip:box type="radio" name="rfsnatureotherselect" title="<%=quaParetoGlobal%>" thcssclass="titreVert" checked="true" onclick="javascript:choix(document.nrPoste,1)" value="1" >
<table>
<tr>
<td> <oip:radio name="rfsnatureselect" dataname="rfsnatureselect" value="1" onclick="javascript:choix(document.pareto,1)" />
</td>
<td> <i18n:message key="quaRfs" bundleRef="defaut" />
</td>
<td>
</td>
<td> <oip:radio name="rfsnatureselect" dataname="rfsnatureselect" value="2" onclick="javascript:choix(document.pareto,1)" />
</td>
<td> <i18n:message key="quaNature" bundleRef="defaut" />
</td>
<td>
</td>
<td> <oip:radio name="rfsnatureselect" dataname="rfsnatureselect" value="3" onclick="javascript:choix(document.pareto,1)" checked="true" />
</td>
<td> <i18n:message key="quaRfsNature" bundleRef="defaut" />
</td>
</tr>
</table>
</oip:box>
</td>
</tr>
<tr> <td> <input type="radio" name="rfsnatureotherselect" value="2" size="10" onclick="javascript:choix(document.pareto,2)"> Choix des colonnes </td>
</tr>
</table>
</oip:box>
et voici la fonction associée :
===================
function choix(formulaire, id) {
if (id == '1') {
formulaire.rfsnatureotherselect['0'].checked=true;
formulaire.rfsnatureotherselect['1'].checked=false;
}
if (id == '2')
{
formulaire.rfsnatureotherselect['1'].checked=true;
formulaire.rfsnatureotherselect['0'].checked=false;
}
if ((formulaire.rfsnatureotherselect['0'].checked==false) && (formulaire.rfsnatureotherselect['1'].checked==false)) {
formulaire.rfsnatureotherselect['0'].checked=true;
}
if (formulaire.rfsnatureotherselect['1'].checked==true) {
formulaire.rfsnatureotherselect['0'].checked=false;
formulaire.rfsnatureselect['0'].checked=false;
formulaire.rfsnatureselect['1'].checked=false;
formulaire.rfsnatureselect['2'].checked=false;
}
if (formulaire.rfsnatureotherselect['0'].checked==true) {
formulaire.rfsnatureotherselect['1'].checked=false;
if ((formulaire.rfsnatureselect['0'].checked==false) && (formulaire.rfsnatureselect['1'].checked==false) && (formulaire.rfsnatureselect['2'].checked==false)) {
formulaire.rfsnatureselect['2'].checked=true;
}
}
}
et voilà l'erreur associée lors du reclique sur le premier bouton radio :
==============================================
"rfsnatureotherselect a une valeur nulle ou n'est pas un objet.."
Auriez vous une idée sur ce type d'erreur:
Partager