par
Invité » 17 mai 2007, 21:30
Bonjour,
J'utilise la fonction suivante pour effectuer une redirection quand un item de liste déroulante est sélectionné:
function Lien() {
var i = window.document.forms["Liste"].selectedIndex;
if (i == 0) return;
url = window.document.forms["Liste"].options[i].value;
parent.location.href = url;
}
Et dans la page html :
<SELECT NAME="Liste" onChange="Lien();" style="margin:0px; padding: 0px;">
<OPTION VALUE="">Choisir une option</OPTION>
<OPTION VALUE="admin.php?page=stats&etat=off" <?php echo ($row['Etat'] == "off" ? "selected" : "" ); ?> >En congés</OPTION>
<OPTION VALUE="admin.php?page=stats&etat=on" <?php echo ($row['Etat'] == "on" ? "selected" : "" ); ?> >En activité</OPTION>
</SELECT>
La fonction marche parfaitement sous firefox, mais me retourne une erreur sous ie:
Error: identificateur attendu
Voyez vous ce qui cloche?