After speaking offline with Gregory, I decided to post this to the list in
case it helps anyone else.
Q. How would I set the property for the "submit"? I'm using a
LookupDispatchAction to process the submit.
A. From the LookupDispatchAction docs:
"The button name is specified by the 'parameter' property of
the corresponding ActionMapping."
While the docs might be slightly off (you don't actually have to use a
button),
the name/value pair submitted will be used to lookup the key/value from
the
resource bundle. That value should match a method in your action.
Quick and dirty example:
<form name="frm" action="?same-page" method="GET">
<input type="hidden" name="action" value=""/>
<input type="checkbox" name="users" value="Test1">Test1<br>
<input type="checkbox" name="users" value="Test2">Test2<br>
<input type="checkbox" name="users" value="Test3">Test3<br>
<input type="checkbox" name="users" value="Test4">Test4<br>
<input type="checkbox" name="users" value="Test5">Test5<br>
<br>
<a href="JavaScript:doForm('users.actions.add')">Add</a> |
<a href="JavaScript:doForm('users.actions.delete')">Remove</a>
</form>
<script>
function doForm(action){
document.forms['frm'].elements['action'].value=action;
document.forms['frm'].submit()
}
</script>
...watch the address bar as you click on either of the links.
--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
770-822-3359
AIM:jmitchtx
----- Original Message -----
From: "Gregory F. March" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 3:22 PM
Subject: Form submit without button or image?
>
> I'm not sure if this is a struts question or not, but I have a
> DynaActionForm and I'd like to add, for lack of a better term, a
> "submit link".
>
> I want a link that submits the form, but I don't want a button or an
> image. Can this be done?
>
> Thanks,
>
> /greg
>
> --
> Gregory F. March -=- http://www.gfm.net:81/~march -=-
AIM:GfmNet
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]