User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,231 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,202 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 617 | Replies: 5
Reply
Join Date: Oct 2006
Posts: 128
Reputation: Barefootsanders is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
Barefootsanders Barefootsanders is offline Offline
Junior Poster

Javascript help

  #1  
Nov 8th, 2007
Hey everyone,

I'm working on some javascript code. What i have now is a list box that contains certain elements and another list box, blank at the moment, next to it. I want, when someone clicks an element within the first list box, that in the background, a MySQL statement is run that will select everything pertaining to the selection. Like "SELECT * from TABLE_NAME WHERE coulumn = SELECTED ELEMENT". I was hoping someone could point me in the right direction as to how to perform this. Thanks!

-barefoot
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2006
Location: ★★ijug.net★★
Posts: 817
Reputation: ithelp is on a distinguished road 
Rep Power: 4
Solved Threads: 61
ithelp ithelp is offline Offline
Practically a Posting Shark

Re: Javascript help

  #2  
Nov 8th, 2007
May not be possible, use server side script like php
Reply With Quote  
Join Date: Feb 2006
Posts: 1,356
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 8
Solved Threads: 113
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: Javascript help

  #3  
Nov 8th, 2007
AJAX maybe, to connect to a Servlet (or some other serverside program) that returns the results.

But, in any case, this is a JSP/Java forum, not JavaScript, please post this type of question in a JavaScript forum, next time. I have already asked the admins to move this one.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Oct 2006
Posts: 128
Reputation: Barefootsanders is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
Barefootsanders Barefootsanders is offline Offline
Junior Poster

Re: Javascript help

  #4  
Nov 8th, 2007
Ooops. Sorry. I clicked the wrong forum.

Thanks for the responses though. Would it be possible to run a PHP script through a javascript call?
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,732
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 323
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Javascript help

  #5  
Nov 8th, 2007
This example does exactly what you want. Also try to read a few links from this page if you plan on some serious stuff with possibly a good book by your side.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Aug 2007
Posts: 74
Reputation: lookof2day is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 8
lookof2day lookof2day is offline Offline
Junior Poster in Training

Re: Javascript help

  #6  
Nov 8th, 2007
Well you require a combination of JSP and JavaScript. I don't have the code right now but will work on it and provide it to you. The logic is:

1) Retrieve a java.util.List of Objects from database in a user session.

2)Iterate over the java.util.List and populate the objects in HTML list.

3)Use Java Script and use onClick/onChange method of list to call another Servlet/JSP.

4) Use <jsp:include> to embed the second JSP with an html list in the first JSP.

5) Write the logic for populating the html list in the second JSP with the elements of the first one
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 4:06 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC