You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rob Breeds <Ro...@uk.ibm.com> on 2001/11/15 23:58:27 UTC
links to javascript with index variables
In my ActionForm I have a collection of names which is added to
dynamically. If I want to give each name its own delete link I'm doing this
with iterate:
<logic:iterate id="el" name="reallySimpleForm" property="names">
Name: <bean:write name="el"/> <html:link href
="javascript:subForm(document.forms[0],'del');"><bean:message key
="link.delete"/></html:link><BR>
</logic:iterate>
(where subForm is a JavaScript function to submit the form, and set an
action, of 'del' in this case)
but how do I add an index value into the javascript call for the link? To
generate something like:
<html:link href="javascript:subForm(document.forms[0],'del', 0) (last param
being the index)
<html:link href="javascript:subForm(document.forms[0],'del', 1)
<html:link href="javascript:subForm(document.forms[0],'del', 2)
.
.
.
Is the only way to do this using scriptlets?
Thanks
Rob Breeds
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>