why not use : <input type="submit" name="edit" value="10"> or <input type="submit" name="delete" value="10">
olivier ----- Original Message ----- From: "Peter Severin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 05, 2002 4:10 PM Subject: Multiple submit buttons solution > Hi folks, > > I've been searching for a solution for multple submit buttons in the > same form > and how it can be achieved without using javascript. Summing up > different suggesstions > I came with the following solution. We can encode additional parameter > values into the submit button name and make struts handle this > parameters transparently for us. > For example we could have the following html code: > <input type="submit" name="deleteItemId_10" value="Delete"> > > ActionServlet would detect this parameter and auto populate the form > with parameter 'deleteItemId' and value '10'. > To extend this idea further we could have the following code: > > <input type="submit" name="action_delete_itemId_10" value="Delete"> > <input type="submit" name="action_edit_itemId_10" value="Edit"> > > In the action we could test form.getAction() parameter value and to > dispatch to the coresponding delete/edit method inside which we coule > use form.getItemId() to execute the operation. > You've got the point. > I would like to hear comments and suggestions on this. I am willing to > post the actual code in the future if the idea proves itself valuable. > > Regards, > Peter. > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>