1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| //fonction
<head>
<script>
function fct(first,second) {
if (document.getElementById(first).checked)
document.getElementById(second).disabled = true;
else
document.getElementById(second).disabled = false;
}
</script>
</head>
partie formulaire php
for ($i=0;$i<$nb;$i++)
{
echo "<INPUT type=radio name='availability".$i."' value='Y'>Yes";
echo "<INPUT type=radio name='availability".$i."' value='N'>No";
$c = 'check'.$i;
$d = 'text'.$i;
echo "<INPUT type=radio id='$c' name='availability".$i."' value='not applicable' onClick="fct('$c','$d');" >not applicable</td>\n";
echo "<INPUT TYPE='text' id='$d' name='code'>";
echo "<br>";
} |
Partager