struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shoukat, Faisal" <>
Subject RE: [OT] calling js function with list backed form value
Date Thu, 04 May 2006 13:36:53 GMT
If I use the html; text property the only diff would be 
<html:text property="<%="benefits["+index.intValue()+"].value"%>" size="20"

I still have the same problem. If I put this in then the value becomes


-----Original Message-----
From: vijay venkataraman [] 
Sent: 04 May 2006 13:12
To: Struts Users Mailing List
Subject: Re:[OT] calling js function with list backed form value

In your JS function can you add 'this' as one of the parameter. Then in 
your js function you can get the value from the element.
Like <input type="text" onclick="return someFunction(this)"/> which 
implies the element on which the event occured.
Note: I have never used <bean:xxx tags> and  don't know much about it.  
My thoughts.

Vijay Venkataraman

Shoukat, Faisal wrote:

>I have a list backed action form and want to call a javascript function
>one of the parameters to the function being a value from the list backed
>action form. 
>My js function is as such:
><bean:define id="jsFunction">
> javascript:calculate('<%="benefits[" + index.intValue() + "].value"%>',
>                    '<bean:write name="benefit" property="benMaxRange"/>',
>                    '<bean:write name="benefit" property="benMinRange"/>',
>                    '<bean:write name="benefit" property="benRange"/>',
>                    '<bean:write name="benefit" property="label"/>')
>The value I want substituted into the function is <%="benefits[" +
>index.intValue() + "].value"%>
>My input text tag is as such which calls the function:
><input type="text" name="<%="benefit["+index.intValue()+"].value"%>"
>value="" size="20" onblur="<%=jsFunction%>"/>
>Can anyone help with explaining how to get the value from the input text
>of the form and send it to the function. The text boxes name is dynamic
>causes me problems.
>The html source shows the following: benefit[0].value in the function and
>not the actual value.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

To unsubscribe, e-mail:
For additional commands, e-mail:

The Northgate IS Content Screening and Inspection system has scanned this 
message for malicious and inappropriate content and none was found. Please
take care 
when opening attachments even when these are expected and from known and

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message