wood burning stoves 2.0*
The moose likes Servlets and the fly likes Multiple Submit button in one jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple Submit button in one jsp" Watch "Multiple Submit button in one jsp" New topic
Author

Multiple Submit button in one jsp

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
I have a have a deal.jsp. In this I have two buttons
one for query and one for submit.
<html>
<head>
<title>Untitled Document</title>
</head>
<form name="form1" action="multitest.jsp" method="post">
<input type="text" name="textfield">
<input type="submit" name="Submit2" value="Submit Whole Form">
</form>
<form name="form2">
<input type="text" name="textfield2">
<input type="text" name="textfield21">
<input type="submit" name="Submit" value="Query">
</form>
</body>
</html>
On load of this page I will get values from Bean and database and load it most of the values are in form1.
In form2 textfield2 user enters soem value and clicks on query button and then i need to go to database and get some more value and place them in form2 textfield21.
finally user clicks on form1 then i want take all values form form1 as well as form2 to submit it to process.jsp.
How do i achive this? When user clicks on query i have to get value form database but without submitting anything.
any help appreciated.
Thanks
Ravi
Maky Chopra
Ranch Hand

Joined: Apr 11, 2001
Posts: 149
You can do this is a lot of different ways.. your query could take you to page 3 where you get the data from the db and redirect to page2 while keeping all the data from form1 and form2 in sessions.. That way process.jsp will also be able to pick up the data from sessions where necessary.
Another interesting way (and I havn't tried this) is remotehostscripting.. here is an artical on it.. let us kow if it works..
http://www-106.ibm.com/developerworks/library/wa-resc/?dwzone=web
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Submit button in one jsp
 
Similar Threads
Sending value of input-form to two pages
URL parameter ~~howto ?
session tracking using servlets and sessions
Urgent problem
Form within form