You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yannick Lesage <ya...@it-omics.com> on 2003/03/17 14:45:26 UTC
javascript function call with parameter
Hi,
I'm trying in a JSP page to move items between 2 lists.
This is done via a javascript method that call my action:
function rightMove(nbForm){
document.forms[nbForm].elements['sense'].value="right";
document.forms[nbForm].submit();
}
This function is called on the "ondblclick" javascript method on the
<html:select> tag :
<html:select property="databaseSelectedValues" size="7" style="width:100%"
ondblclick="javascript:rightMove(<%= nbForm %>)">
<html:options property="databaseValues" />
</html:select>
The problem is that my java parameter 'nbForm' that gives the form number to
be sumitted isn't parsed correctly, the HTML output looks like :
<select name="databaseSelectedValues" size="7"
ondblclick="javascript:rightMove(<%= nbForm %>)" style="width:100%">)
If I put the same funtion on a href link for instance, it works perfectly :
<a href="javascript:rightMove(<%= nbForm %>)" title="Copy the selected
values in the second list">
<img src="files/images/idxdown.gif" border=0/>
</a>
Does anyone know the syntax of such a command?
Thanks
Yannick
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org