"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

Go Back   Webmaster Forums > Code Forum > Javascript Forum

Reply
 
Thread Tools Rate this Webmaster Discussion
Old 11-01-2009, 09:39 PM   #1
Bigmous
Junior Member
 
Join Date: Dec 2008
Location: Sydney, Australia
Webmaster Discussions: 27
Rep Power: 11
Bigmous is on a distinguished road
Exclamation Major uni project emergency!!! add/remove data from one list to another

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


Bigmous is offline   Reply With Quote
Reply

Bookmarks

Tags
major, uni

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT -5. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.