| | |
Javascript help
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 164
Reputation:
Solved Threads: 3
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
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
May not be possible, use server side script like php
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.
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
----------------------------------------------
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
•
•
Join Date: Aug 2007
Posts: 80
Reputation:
Solved Threads: 10
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
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
![]() |
Similar Threads
- Javascript links not working (Web Browsers)
- JavaScript's window.opener (JavaScript / DHTML / AJAX)
- recommendations for JavaScript learning resources? (JavaScript / DHTML / AJAX)
- Javascript/HTML problem!!! (JavaScript / DHTML / AJAX)
- Javascript Useful? (IT Professionals' Lounge)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Enter key does not work in window.showModalDialog
- Next Thread: Images, thumbnails, and iFrames
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child class close column cookies createrange() css cursor debugger dependent disablefirebug dom download dropdown editor element embed engine error events explorer ext file form forms google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe images internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jump libcurl math media microsoft mimic object onmouseoutdivproblem onreadystatechange parent paypal pdf php player position post problem programming progressbar regex runtime scroll search security select session shopping size software sql text textarea unicode w3c web website window windowofwords windowsxp wysiwyg \n






