This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Submit button in one jsp

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic