You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Teh Noranis Mohd Aris <te...@yahoo.com> on 2007/03/29 04:23:09 UTC

Is it possible to have more than one submit button in a JSP file?

Dear All, 
   
  I hope all of you can still remember me. I had the problem of writing the file content from an applet to a servlet. Now, I'm using JSP and it works. However, from JSP code examples, I always see only one submit button to the server. I would like my system to have several submit buttons that is connected to the server, for example a button for displaying a file from the server and a button for saving a file to the server. The file to display and the file to save should use the same textarea. How should it be done? If there are any source code examples, can anyone please post it to me? Please help! Thank you.
   
  Yours Sincerely,
  TEH NORANIS 

 
---------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

Re: Is it possible to have more than one submit button in a JSP file?

Posted by or...@kewlstuff.co.za.
Something like this

In Form
<input type="submit" value="START" name="start">
<input type="submit" value="STOP" name="stop">

In servlet
String sValueStart = request.getParameter("start"); //The one clicked will 
have a value
String sValueStop = request.getParameter("stop"); //The one clicked will 
have a value

Write reponse to Text Area etc...





----- Original Message ----- 
From: "Teh Noranis Mohd Aris" <te...@yahoo.com>
To: <us...@tomcat.apache.org>
Sent: Thursday, March 29, 2007 4:23 AM
Subject: Is it possible to have more than one submit button in a JSP file?


> Dear All,
>
>  I hope all of you can still remember me. I had the problem of writing the 
> file content from an applet to a servlet. Now, I'm using JSP and it works. 
> However, from JSP code examples, I always see only one submit button to 
> the server. I would like my system to have several submit buttons that is 
> connected to the server, for example a button for displaying a file from 
> the server and a button for saving a file to the server. The file to 
> display and the file to save should use the same textarea. How should it 
> be done? If there are any source code examples, can anyone please post it 
> to me? Please help! Thank you.
>
>  Yours Sincerely,
>  TEH NORANIS
>
>
> ---------------------------------
> Need Mail bonding?
> Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Is it possible to have more than one submit button in a JSP file?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 3/28/07, Teh Noranis Mohd Aris <te...@yahoo.com> wrote:

>  Maybe my question is not that clear. What I mean, is that there are
> 2 buttons that read data from the server and write data to the server
> using one textarea.

OK, so? It's basic webapp stuff. Is there an actual technical question
here /about Tomcat/?

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Is it possible to have more than one submit button in a JSP file?

Posted by Foo Shyn <fo...@optegra.com.my>.

Thanx.
Regards,
FooShyn
----- Original Message ----- 
From: "Teh Noranis Mohd Aris" <te...@yahoo.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, March 29, 2007 12:21 PM
Subject: Re: Is it possible to have more than one submit button in a JSP 
file?


> Dear All,
>
>  Maybe my question is not that clear. What I mean, is that there are 2 
> buttons that read data from the server and write data to the server using 
> one textarea.

You could try using javascript to control your onClick function of your 
buttons. Pass in different params to your servlet to differentiate the 
action (i.e. pass in a param ="read" when you read from the file and a param 
"write" when you wanna write to the file) so that your servlet could perform 
the relevant action.

> If anyone have the code or come across the code, please e-mail it to me. 
> Thank you.

Sorry, can only show you the door, you're the one that gotta walk through it 
:)

>
>  TEH
>
> Hassan Schroeder <ha...@gmail.com> wrote:
>  On 3/28/07, Teh Noranis Mohd Aris wrote:
>
>> I would like my system to have several submit buttons
>
> This is a basic HTML question, nothing to do with JSP.
>
> Yes, a form in an HTML document can have multiple submit buttons;
> reading the appropriate recommendation is, uh, recommended :-)
>
> HTH,
> -- 
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
> ---------------------------------
> Don't be flakey. Get Yahoo! Mail for Mobile and
> always stay connected to friends.


--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.20/737 - Release Date: 3/28/2007 
4:23 PM



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Is it possible to have more than one submit button in a JSP file?

Posted by Teh Noranis Mohd Aris <te...@yahoo.com>.
Dear All,
   
  Maybe my question is not that clear. What I mean, is that there are 2 buttons that read data from the server and write data to the server using one textarea. If anyone have the code or come across the code, please e-mail it to me. Thank you.
   
  TEH   

Hassan Schroeder <ha...@gmail.com> wrote:
  On 3/28/07, Teh Noranis Mohd Aris wrote:

> I would like my system to have several submit buttons

This is a basic HTML question, nothing to do with JSP.

Yes, a form in an HTML document can have multiple submit buttons;
reading the appropriate recommendation is, uh, recommended :-)

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.

Re: Is it possible to have more than one submit button in a JSP file?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 3/28/07, Teh Noranis Mohd Aris <te...@yahoo.com> wrote:

> I would like my system to have several submit buttons

This is a basic HTML question, nothing to do with JSP.

Yes, a form in an HTML document can have multiple submit buttons;
reading the appropriate recommendation is, uh, recommended :-)

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org