Bonjour à tous !
Je développe actuellement une application en VB.NET . Dans cette application, j'ai une liste déroulante (ListBoxType) qui comprend 4 items : "", "CIM10", "CCAM" et "SNOMED". Quand je clique sur "CIM10", je fais appel à une fonction javascript qui doit m'ouvrir le fichier XML. Mais j'ai un souci dont je n'arrive pas à déterminer l'origine.
Voici mon code VB.NET (je marche avec un repeater) :
Et voici mon code javascript :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 Protected Sub rptListeChamps_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptListeChamps.ItemDataBound ... Dim lst_code As DropDownList ... lst_code.Attributes.Add("onchange", "javascript:verif_type('" & lst_code.ClientID & "');")
Enfin, voici le message d'erreur que je reçois :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 function verif_type(nom_champ) { alert("ici"); alert(nom_champ); /*if(eval(document.forms[0].getElementById(nom_champ).options[document.forms[0].getElementById(nom_champ).selectedIndex]) == "CIM10"){ window.open('../xml_CIM10.xml','','width=950, height=680, scrollbars=yes, left=30, top=10, toolbar=no, menubar=no, resizable=yes'); }*/ alert(eval(document.forms[0].' + nom_champ + '.options[document.forms[0].' + nom_champ + '.selectedValue])); if(document.getElementById(nom_champ).selectedValue == "CIM10"){ window.open('../xml_CIM10.xml','','width=950, height=680, scrollbars=yes, left=30, top=10, toolbar=no, menubar=no, resizable=yes'); } return; }
A mon avis, ceci est lié à la fonction, car quand je la met en commentaires, il n'y a plus d'erreurs. Merci de votre aide !
Partager