This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes jsp sending values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp sending values" Watch "jsp sending values" New topic
Author

jsp sending values

dale conn
Ranch Hand

Joined: Jun 16, 2006
Posts: 57
hi all i'm looping through a sql recordset and writing out on the page. each row has a send button. when i click the send button it goes to another jsp page where i'm prining out the vlaues i'm passing through from the first jsp page using request.getParameter("value1"), request.getParameter("value2")

However the values being passed are always the top row values regardless of the row i'm choosing




i get something like this

12345 321 send button
98765 654 eend button

When i click the send button, the values are always 12345 and 321, even if i press the 2nd button

can anyone help me out so whatever button i press i get the correct values passing through

many thanks
Tom Joiner
Ranch Hand

Joined: Sep 19, 2006
Posts: 47
If you made each separate table row its own form, that might help, it looks like they are all in one form.

Alternatively, change the name of every item to be unique per row, because currently you have many items with the same name, so it is just using the first one.


SCJP
dale conn
Ranch Hand

Joined: Jun 16, 2006
Posts: 57
Thanks for the reply.

Are you able to give me an example? I'm not too sure what you mean

Many thnaks
dale conn
Ranch Hand

Joined: Jun 16, 2006
Posts: 57
no worries sorted it
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp sending values
 
Similar Threads
Exam and WhizLabs!!!
Display of Latin Characters
How to store option format value in database in jsp
using getReader() of ServletRequest
Cannot Compile Class error on Tomcat 6.0