can you click a button, send a forms content and a parameter (like id?)

is it possible to have a button that sends a form's content and have it send a parameter as well (like doSomthing?id=433)

<html:submit value="b1" onclick="this.form.reqCode.value='doSomthing'"/>

if not, how can I get the name of the button from the invoked method?

thank you

[359 byte] By [xianwinwina] at [2007-11-26 18:50:54]
# 1

Yes you can.

In fact the code you have posted here looks like it would do it. - you are setting the hidden field reqCode (which will be submitted as a parameter) to 'doSomthing'

Normally I would write the onclick event to call a function rather than directly do something like this, but it should work.

What is it you are trying to accomplish?

evnafetsa at 2007-7-9 6:24:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I'm trying to invoke a method and from the method to tell on whan ID i was talking about (so the method will perform the operation on a specific object)

at first, I tried to that with a link but I couldn't pass the form's information (struts). I did somthing like:

<a class="menulink" href="level.do?reqCode=addlevel&level_id=6">6</a>

xianwinwina at 2007-7-9 6:24:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...