File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes ask for the pass value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "ask for the pass value" Watch "ask for the pass value" New topic
Author

ask for the pass value

albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i want to passing value in the same page. i want the user to choose the data from the combo box in the page, after the user select the data will directly retrieve out from the database depend on the information selected and display out in the same page. is it posible to do it?

if can please provide me suggestion and comment. thank you for the help.

regards,
albert


JAVA the only can called technology
Ajith George
Ranch Hand

Joined: Dec 22, 2005
Posts: 109
If you want to do this with out submitting the page upon dropdown value selection, you need to use AJAX or some thing similar.

Another method: You can initialy fetch whole data and store it on local variables when page loads initialy. This is a very bad way of coding.

Next method is submit the page upon onChange and retrive data and show it according to the selection.


SCJP 1.4, Brainbench
LinkedIn - Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61753
    
  67

Moved to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i still get nothing of this. if i using httprequest method can

can you provide some of the tutorial about this matter thank you
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
that is called AJAX.
this whole forum has innumerable posts related to AJAX.
Try googling. you will find many links which provide free tutorials.


Life called,so here I am.<br />Cheers<br />Niki.:-)
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i really cannot get what the ajax talking about. i want to get the value that user select in the combo box and pass it to the same page for doing data retrieving from database. but i no idea to do it. i also go through the xmlHttpRequest but i still donno how to create it. AJAX really hard to learn lah.
any one here please give me the solution and enlighten me in this problem . thank you.

regards,
albert
Thara Visu
Ranch Hand

Joined: May 17, 2005
Posts: 87
Hi all,
I am not sure if I understand the situation, but shouldn't a submit on the onchange of the dropdown work? Should we opt for AJAX in such a situation also?


Thara<br />SCJP 1.4 96%<br />SCBCD 1.3 96%
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Look at this post here which points to a sample chapter in my book and another example.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
whooops...the link: http://www.coderanch.com/t/117416/HTML-JavaScript/ajax-dynamic-combo
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
my situation is like this, i have 1 jsp page. in the jsp page i have 2 combo box for user to select. what i want is after the user do the selection in 2 combo box, the page will directly retrieve out the data depend on the combo box value selected by user. so the main key is the value in combo box. how i gotta to write this code to make it can retrieve the database after user select and without reload the page. please provide me the relevent example. i also go through many AJAX material but i don't understand what the usage of the coding. i want the page write in jsp and java code.

thank you.
regards,
albert
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
And you are going to pay us how much to code it for you? You need to try to get it to work. Show us what you have tried.

Eric
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
if yiou want to do anything related to the database then you have got to go to the server. there are two ways of doing it in javascript which i am aware of. One is to post the whole page to a second JSP which will act on the values recived and prepare the html that you want.
Another is to use AJAX which will fetch the data from the server without refereshing the whole page.

you need to do this onchange of the second select box.
Please do not ask for code, you can write it on your own. Ultimately code is not that important, understanding the concept is important because that is what you remember and not the code.
just a friendly advice.
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
HERE IS THE CODE THAT I WRITE, I STUCK IN THE AJAX PART.

albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
i request to close this topic. i think i need to understand more about the ajax, so i make decision to close this topic and open a new topic to understand the ajax from the beginning. thank you for the co operation .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ask for the pass value