struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Galbreath" <mark_galbre...@qat.com>
Subject RE: Form submit without button or image?
Date Tue, 03 Jun 2003 20:39:44 GMT
thanks, LISP-boy...good clue on usage!

-----Original Message-----
From: James Mitchell [mailto:jmitchell@apache.org] 
Sent: Tuesday, June 03, 2003 4:35 PM
To: Struts Users Mailing List
Subject: Re: Form submit without button or image?


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" <march@gfm.net>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message