"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]