It's not a secret anymore!*
The moose likes JDBC and the fly likes pass the value to next form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "pass the value to next form" Watch "pass the value to next form" New topic

pass the value to next form

Sujay Nadkarni
Ranch Hand

Joined: Jul 03, 2008
Posts: 34
I have made two forms. The first one has a drop down list. it takes the value from the database. When i click on submit it takes me to another form. There is a drop down list in the other form which again retrieves value from the database. it also has a textbox. I want the value of the textbox to be equal to the selected option of the first form. These are my codes.

2nd form

I have used string.getParameter and retrieved the value of the drop down list and stored in String variable name. When i put that in the value of the textbox the selected option doesnt appear!!
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Firstly , Do not use Scriplets in JSP, Submit to Servlet , and use Utility class to get DB operations and send teh result to JSP to display it.

For your current problem , to access scriplet variable use <%=name%> instead of "name" in the above case
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703

DO NOT PUT JDBC CODE INSIDE OF JSP. It's a sign of a really really bad developer.

I swear this is going to become my catch phrase.

My Blog: Down Home Country Coding with Scott Selikoff
Sujay Nadkarni
Ranch Hand

Joined: Jul 03, 2008
Posts: 34
thanks balu and scott!! it worked!!
I agree. Here's the link:
subject: pass the value to next form
Similar Threads
JSP form with four inputs and one submit button
retreiving data through jsp
Read (access) FireFox cookies.sqlite file
Fetching information from database in jsp
Connection with database...