aspose file tools*
The moose likes JSP and the fly likes Access Data from Database By Submitting The select Values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Access Data from Database By Submitting The select Values" Watch "Access Data from Database By Submitting The select Values" New topic
Author

Access Data from Database By Submitting The select Values

Babu Singh
Ranch Hand

Joined: Aug 17, 2009
Posts: 78
i am making a program in a JSP. i have used some java script code in this program.

by this program i can find out the result for between years for any class.
i have three combo box for class_name, from_year, to_year. for class_name, Its value is 1 to 12. when i select class 11 or 12, an combox appear for subject having values Arts, comerce and science will be appeared.

in database for class 1 to 10 having subject values is AllSubject. and for class 11 or 12 having subject values arts, commerce and science.

my problem how i make the query which send for class 1 to 10 , assume subject values is all and for class 11 or 12 subject values arts, commerce and science with others combox values.

Here is JSP's files:

display.jsp:
show.jsp:

the combo box for subject remain hide when i select class 1 to 10. but if i select class 11 or 12 then
value for subject is Arts, Commerce and Science. how i make query from database base on the subject.
if i select class 1 to 11 the value for subject is all. if i am selected class 11 or 12 then query include the value of combo box subject

please help.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please indent your code. Without proper indentation even the simplest code, HTML, anything becomes a jumbled soup, impossible to understand.show.jsp
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You will also find that your HTML is malformed, in several areas, in several different ways.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

There is no such thing as a "combo box" in HTML. Please read this for more information. I have adjusted your topic title for you.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not quite sure what you're asking: are you asking how to make a request from the browser to the server, or how to show an element based on the value of another, or...? Could you try asking it in a different way?

Moving to JSP, although the HTML is very broken, and contains some suspicious tags, which should not be used.

Also note that you will be told not to do any Java programming in your JSP files--this is good advice.
Babu Singh
Ranch Hand

Joined: Aug 17, 2009
Posts: 78

In database for class 1 to 10 having value for subject is all. and for class 11 or 12, having value arts, commerce and science.

if i select class 1 to 10 from combo box for class then subject remains hide, after submit its show the result. it will show the result for a class having subject is all.
because in database for class 1 to 10 the subject value is all, but when i select class 11 or 12, then a combo box for subject appear and its value will be Arts, Commerce and Science. then when i select subject any one from these. suppose i select class 11 or select subject science, after submit it go for query from database for a class 11 and for subject science.

how i find the result for a science subject for a class 12.

i am not able to make query that find the result when i select class 11 or 12 for a particular subject.

please help.
praneel shah
Greenhorn

Joined: Mar 16, 2010
Posts: 17
if you are using hibernate then it is very easy to do it.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access Data from Database By Submitting The select Values