• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

ask for the pass value

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the HTML/Javascript forum.
 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i still get nothing of this. if i using httprequest method can

can you provide some of the tutorial about this matter thank you
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that is called AJAX.
this whole forum has innumerable posts related to AJAX.
Try googling. you will find many links which provide free tutorials.
 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at this post here which points to a sample chapter in my book and another example.

Eric
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
whooops...the link: https://coderanch.com/t/117416/HTML-JavaScript/ajax-dynamic-combo
 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HERE IS THE CODE THAT I WRITE, I STUCK IN THE AJAX PART.

 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
For my next trick, I'll need the help of a tiny ad ...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic