J'ai un probleme coté javascript avec IE7, j'ai une page html avec une fonction nommé cacher()
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Carnet de Stage</title>
<script language="JavaScript" src="js/heure.js"></script>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
function cacher()
{
document.getElementById("divgr").style.visibility='hidden'
document.getElementById("div" + document.getElementById("groupe").value).style.visibility='visible'
}
</script>
</head>
<body onLoad="getDt();">
<form name="form1" action="send.php" method="POST" target="_parent">
<center><br><input type="hidden" id="url" name="url">
<div id="divgr" name="divgr" style="visibility : visible;">
Groupe:
<br>
<select id="groupe" name="groupe">
<option value="Aucun" selected >Selectionner Groupe</option>
<option value="gr102" onclick="cacher()">102</option>
<option value="gr103" onClick="cacher()">103</option>
<option value="gr104" onClick="cacher()">104</option>
<option value="gr105" onClick="cacher()">105</option>
</select>
</div>
<div id="divgr102" name="divgr102" style="visibility : hidden;">
Élève:
<br>
<select id="eleve_gr102" name="eleve_gr102">
<option value="Aucun" selected >Selectionner Nom</option>
<option value="RaphaelG" onSelect="">Raphael Gagné</option>
<option value="gr103" onSelect="">103</option>
<option value="gr104" onClick="">104</option>
<option value="gr105" onSelect="">105</option>
</select>
</div>
mot de passe <br>(pour pouvoir modifier):</br><input type="password" id="password" name="password">
<br><br>Prénom: <input id="prenom" name="prenom" size="16">
<br><br>Fiche: <input id="fiche" name="fiche" size="14">
<br><br>Image: <input id="image" name="image" value="http://">
<br><br>Date: <input name="date" id="date" value ="">
<BR><BR>Texte:
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
Choisiser un theme visuels :
</td>
<td>
<select id="cmbSkins" onchange="ChangeSkin(this.value);">
<option value="default">Default</option>
<option value="office2003" selected="selected">Office 2003</option>
<option value="silver">Silver</option>
</select>
</td>
</tr>
</table>
<br>
<div><input type="hidden" id="FCKeditor1" name="FCKeditor1" style="display:none" /><input type="hidden" id="FCKeditor1___Config" value="CustomConfigurationsPath=/fckeditor.config.js&SkinPath=/fckeditor/editor/skins/office2003/&PreloadImages=/fckeditor/editor/skins/office2003/images/toolbar.start.gif;/fckeditor/editor/skins/office2003/images/toolbar.end.gif;/fckeditor/editor/skins/office2003/images/toolbar.bg.gif;/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif;" style="display:none" /><iframe id="FCKeditor1___Frame" src="/fckeditor/editor/fckeditor.html?InstanceName=FCKeditor1&Toolbar=Default" width="100%" height="500" frameborder="0" scrolling="no"></iframe></div>
<br>
<br>
<input name="Submit" value="Envoyer" type="submit" onClick="if(document.form1.groupe.value == 'Aucun') {javascript:alert('Vous n\'avez pas choisis de groupe.'); return false;} if(document.form1.image.value == 'http://') {document.form1.image.value = 'Aucune image'} if(document.form1.url.value == '') {document.form1.url.value = 'http://slayer418.no-ip.info/ || http://slayer418.no-ip.info/index.html'} if(document.form1.nom.value =='') {javascript:alert('Vous avez oublier de remplire le champ Nom'); return false;} else if(document.form1.password.value =='') {javascript:alert('Vous avez oublier de remplire le champ mot de passe'); return false;} if(document.form1.prenom.value =='') {javascript:alert('Vous avez oublier de remplire le champ Prénom'); return false;}"></center>
</select>
</form>
</body>
</form>
</html>
Le probleme est qu'avec firefox 2.* ma fonction fait ce quel doit faire et qu'avec IE7 ca marche pas , pourquoi?

[ http://www.daniweb.com/forums/thread115562.html]
en gros: on utilise un eval de la value, (ça fait moins de modif)
<select>
<option onclick="my javascript"></option>
<option onclick="my javascript"></option>
<option onclick="my javascript"></option>
</select>
devient
<select onchange="eval(this.value);">
<option value="my javascript"></option>
<option value="my javascript"></option>
<option value="my javascript"></option>
</select>