You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jonathan <jp...@aber.ac.uk> on 2003/03/04 01:57:59 UTC
Iterate + indexed property arghhh....
Hello,
I wonder whether somebody can help, I'm using the logic iterate tag to
loop through a number
of items producing a delete button for each of the items. When the
delete button is
clicked I want to delete that particular item. Using the below:
<html:submit indexed='true' onclick="return confirm('Confirm
Delete?');" property='action'>
<bean:message key="questionoption.button.delete"/>
</html:submit>
I produce a list of buttons which SHOULD appear like follows:
<input type="submit" name="action[0]" value="Delete">
<input type="submit" name="action[1]" value="Delete">
<input type="submit" name="action[2]" value="Delete">
but instead the name appears like this:
<input type="submit" name="action"[0] value="Delete">
With [0] being outside the bracket.
Can anybody tell me why this is? Does it make a difference if I use '
to enclose the values
or whether I use " to enclose the values. It would seem that it does so
does anybody know
the EXACT syntax for specifying a HTML submit button? Should I be using
a nested:submit
component? Does that really make any difference?
Also on the server side how would I catch which button has been pressed?
I can't use:
String action = (String)request.getParameter("action");
Because the index causes a problem,
Many thanks in advance for any help or tips you can provide me with,
this seems to be the last
part of my problems.
Jon.
*---------------------------------------------*
Jonathan Holloway,
Dept. Of Computer Science,
Aberystwyth University,
Ceredigion,
West Wales,
SY23 3DV.
07968 902140
http://users.aber.ac.uk/jph8
*---------------------------------------------*