Thanks for the suggestion, but that doesn't work either. The <nested:submit> tag isn't replaced with an <input> tag when I use the syntax you suggest. I've tried many variations on these syntaxes. If the JSP expression get's parsed, the struts tags aren't understood. If the struts tags are understood the JSP expression isn't parsed.
Any other ideas? Surely this is a common usage pattern. -----Original Message----- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 10:46 AM To: [EMAIL PROTECTED] Subject: Re: Question about logic:iterator, indexId and hidden fields "Eric Hodges" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a form with a list of elements on it. Each element has an "Edit" > button associated with it. When the user clicks the Edit button for a > specific element, I want to send back the value of indexId in a hidden field > on the form. I can't figure out a clean way to do this. The documentation > says "indexId" will create a bean, but it really creates an Integer (which > isn't a JavaBean). I've tried passing my indexId to a Javascript function > that sets the form's hidden field sort of like this: > > <nested:submit propert="edit" value="Edit" > onclick="setEditIndex(<%=index%>)"/> > > but the <nested:submit> tag is evaluated before the <%=index%> tag The problem is that you have illegal JSP syntax for the 'onclick' attribute. The attribute value must be a string literal or a scripting expression. You cannot mix the two. Try this instead: onclick='<%= "setEditIndex(" + index + ")" %>' -- Martin Cooper > > > Right now I've got some ugly JSP code that outputs the submit element that > calls the Javascript function that sets the hidden field. There must be a > simpler way. Any ideas? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]