You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by yan <yi...@kadis.freeserve.co.uk> on 2003/08/01 19:18:12 UTC

2 different submits on a single JSP - how?

Not sure how best to set this up and indeed, if it is possible so any advice
would be appreciated.



I have an ActionForm called 'RegisterForm' that allows a new user to enter
their details (name, email, school name and school address) or, an existing
registered user to edit these fields.



Alongside the 'school address' field I have a submit button, 'Find School'
that allows a user to enter part of the school name or address and hit this
'FindSchool' button which then goes off to another page (selectSchool.jsp)
that displays a list of matching schools.  The user then clicks on their
chosen school on selectSchool.jsp and is then returned to the RegisterForm
with the 'school name' and 'school address' fields populated.



The user then hits another submit (either 'Register Me' or 'Update Details')
button at the bottom of the page which saves the user details.



My query is this: I am aware that I have 2 <html: form action ="someAction">
's, one for the 'Find School' submit button and one for the 'Register
Me/Update Details' submit button.



I have only seen examples where you have a single <html: form action ="
someAction"> tag on a jsp.  Any advice or examples on how I can do it with
the 2 actions that I need on my one JSP



Thanks in advance

yan


KickStartESolutions.com
info@kickstartesolutions.com



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


Re: 2 different submits on a single JSP - how?

Posted by Jing Zhou <ji...@netspread.com>.
----- Original Message ----- 
From: "Tamia Ramírez" <ta...@dev-ez.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>; "yan"
<yi...@kadis.freeserve.co.uk>
Sent: Friday, August 01, 2003 2:04 PM
Subject: RE: 2 different submits on a single JSP - how?


> Give a different value to every submit... in your form make just one
submit
> and ask for its value, so you can know with one they chosse:
>
> <input type="submit" value="Login">
> <input type="submit" value="request"
>

I would consider giving different names to the submit buttons. The reason
is that the value attributes are the display labels of the buttons. They
could
be changed over time. Using the name attributes your business logics
would not have to be changed even if your labels are changed.

Jing
Netspread Carrier
http://www.netspread.com


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


RE: 2 different submits on a single JSP - how?

Posted by Tamia Ramírez <ta...@dev-ez.com>.
Give a different value to every submit... in your form make just one submit
and ask for its value, so you can know with one they chosse:

<input type="submit" value="Login">
<input type="submit" value="request"

-----Original Message-----
From: yan [mailto:yianno@kadis.freeserve.co.uk]
Sent: Friday, August 01, 2003 11:18 AM
To: struts-user@jakarta.apache.org
Subject: 2 different submits on a single JSP - how?


Not sure how best to set this up and indeed, if it is possible so any advice
would be appreciated.



I have an ActionForm called 'RegisterForm' that allows a new user to enter
their details (name, email, school name and school address) or, an existing
registered user to edit these fields.



Alongside the 'school address' field I have a submit button, 'Find School'
that allows a user to enter part of the school name or address and hit this
'FindSchool' button which then goes off to another page (selectSchool.jsp)
that displays a list of matching schools.  The user then clicks on their
chosen school on selectSchool.jsp and is then returned to the RegisterForm
with the 'school name' and 'school address' fields populated.



The user then hits another submit (either 'Register Me' or 'Update Details')
button at the bottom of the page which saves the user details.



My query is this: I am aware that I have 2 <html: form action ="someAction">
's, one for the 'Find School' submit button and one for the 'Register
Me/Update Details' submit button.



I have only seen examples where you have a single <html: form action ="
someAction"> tag on a jsp.  Any advice or examples on how I can do it with
the 2 actions that I need on my one JSP



Thanks in advance

yan


KickStartESolutions.com
info@kickstartesolutions.com



---------------------------------------------------------------------
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