File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "pass the value to next form" Watch "pass the value to next form" New topic
Author

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: 3697
    
    5

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: http://aspose.com/file-tools
 
subject: pass the value to next form
 
Similar Threads
Connection with database...
retreiving data through jsp
Fetching information from database in jsp
Read (access) FireFox cookies.sqlite file
JSP form with four inputs and one submit button