Bonjour,
j'ai deux form, pour chacun, il y a deux select
une fois le premier select est modifies, le contenu du deuxieme sera mis a jour
pour cela j'utilise le onchange du select
voici le code :
et le deuxieme form :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 <html:form action="EditShortList.do?do="> Short list : <html:select property="selectedAddShortlistId" onchange="javascript:launchRefresh(this,'EditShortList.do?do=refreshOrShortList')"> <html:optionsCollection property="shortListsAdd" value="orshortlistId" label="orshortlistNom" /> </html:select> OR : <html:select property="selectedAddOrId"> <html:optionsCollection property="addOrList" value="orId" label="orCode" /> </html:select> <html:submit value="ajouter"/> </html:form>
-fonction javascript :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <html:form action="EditShortList.do?do="> Short list : <html:select property="selectedDeleteShortlistId" onchange="javascript:launchRefresh(this.form,'EditShortList.do?do=refreshOrShortList')" style="width: 127px;"> <html:optionsCollection property="shortListsDelete" value="orshortlistId" label="orshortlistNom" /> </html:select> OR : <html:select property="selectedDeleteOrId" style="width: 127px;"> <html:optionsCollection property="delOrList" value="orId" label="orCode" /> </html:select> <html:submit value="supprimer"/> </html:form>
lors du changement de valeur du premier select, l'action pour le deuxieme formulaire , elle passe, par contre pour le premier ,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 function launchRefresh(theForm,url) { alert(url); theForm.action =url; theForm.submit(); }
il appelle la fonction , mais pas l'action !
avez vous une idee?
Merci
Partager