[struts,javascript] probleme d'affectation d'action
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 :
Code:
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> |
et le deuxieme form :
Code:
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> |
-fonction javascript :
Code:
1 2 3 4 5 6 7 8 9 10
|
function launchRefresh(theForm,url)
{
alert(url);
theForm.action =url;
theForm.submit();
} |
lors du changement de valeur du premier select, l'action pour le deuxieme formulaire , elle passe, par contre pour le premier ,
il appelle la fonction , mais pas l'action !
avez vous une idee?
Merci