You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jarnot Voytek Contr AU HQ/SC <Vo...@MAXWELL.AF.MIL> on 2003/03/17 14:47:50 UTC
RE:[OT] javascript function call with parameter
Why not just do:
<html:select property="databaseSelectedValues" size="7"
style="width:100%"
ondblclick="javascript:rightMove(this.form)">
<html:options property="databaseValues" />
</html:select>
no scriptlet required...
--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.
> -----Original Message-----
> From: Yannick Lesage [mailto:yannick.lesage@it-omics.com]
> Sent: Monday, March 17, 2003 7:45 AM
> To: Struts-User
> Subject: 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org