![]() |
| HTML | PHP Scripts | Webmaster Tools | Webmaster Forums | Web Hosting | Domain Names | Webmaster Books |
|
|
#1 |
|
Junior Member
Join Date: Dec 2008
Location: Sydney, Australia
Webmaster Discussions: 27
Rep Power: 11 ![]() |
I've done something like this using an xml file. But how do you do something like this with a php form and data coming from a SQL Database.
can get data out of a selection list aka listbox, but now need to be able to select and move to and from the empty listbox. this is an example of how i did it last year, which was an AJAX assignment. but not quite sure how to when reading from SQL. _____________________________________________________________ function StudentManager () { var students; } StudentManager.prototype.doIt = function(xmlDoc) { this.students = xmlDoc.getElementsByTagName("student"); var list = document.getElementById("slist"); var z=xmlDoc.getElementsByTagName("subject"); for(i = 0; i < z.length; i++) { if(z[i].attributes.getNamedItem("subjectName").nodeValue == "Interface Design") { var y=z[i].getElementsByTagName("student"); for(j = 0; j < y.length; j++) { var option = document.createElement("Option"); option.innerHTML = y[j].attributes.getNamedItem("surname").nodeValue + ", "+ y[j].attributes.getNamedItem("givenName").nodeValue; option.value = y[j].attributes.getNamedItem("surname").nodeValue + ", "+ y[j].attributes.getNamedItem("givenName").nodeValue; list.appendChild(option); } } } }; Thanks Mous |
|
|
|
![]() |
| Bookmarks |
| Tags |
| major, uni |
| Thread Tools | |
| Rate This Thread | |
|
|
Similar Webmaster Discussions
|
||||
| Thread | Webmaster Discussion Starter | Forum | Replies | Last Post |
| how to close or remove a frame | Codyg | Javascript Forum | 15 | 04-20-2010 08:49 PM |
| Update of data using PHP truncates text data | jej1216 | PHP Forum | 3 | 12-27-2008 11:29 PM |
| How to Remove underline from hyperlink? | squallsq86 | CSS Forum | 5 | 10-27-2005 12:24 PM |
| Remove frames and put everything in one page. | minds_gifts | HTML Forum | 2 | 06-22-2003 11:20 AM |
| remove browser toolbars | mudhead | HTML Forum | 1 | 09-18-2000 11:30 AM |