redirection avec des radios bouttons
Bonjour,
en fait je veux quand je coche un radio boutton et je valide avec la boutton subbmit il dois me rediriger vers une page.php voila mon code mais ca marche pas je ne sais pas pourquoi,n'hésitez pas a m'aider s'il vous plait
code javascript:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<head>
<SCRIPT language="javascript">
function choixpage(form_xml) {
if (form_xml.choix[0].checked)
{window.location.replace="CQ_xml.php"; }
if (form_xml.choix[1].checked) {window.location.replace="QC_xml.php"; }
if (form_xml.choix[2].checked) { window.location.replace="EXCEL_xml.php";}
}
</SCRIPT>
</HEAD> |
code de ma formulaire:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <form method="post" name="form_xml">
<table width="317" border="0">
<tr>
<td colspan="7">Menu</td>
</tr>
<tr>
<td width="93" height="35">Type</td>
<td width="37">CQ</td>
<td width="24"><input type="radio" name="choix" value="CQ" /></td>
<td width="33">QC</td>
<td width="24"><input type="radio" name="choix" value="QC" /></td>
<td width="37">Excel</td>
<td><input type="radio" name="choix" value="Excel" /></td>
</tr>
<tr>
<td height="40"> </td>
<td colspan="5"><input type="submit" name="button" id="button" value="OK" onclick="choixpage(form_xml)"/></td>
<td width="39"> </td>
</tr>
</table>
</form> |
Merci d'avance.