Hi guys, need help again.
I have a ajax-powered "Arrange Content by Drag-and-drop" php page here -> http://network.rxpinoy.com/temp-tester.php
I found the script here -> http://www.dhtmlgoodies.com/index.html?showDownload=true&whichScript=arrange-nodes-2
The page works but I have to be able to save the changes to a database.
Currently, when we click the save button at the end of the page, a dialog box will appear that will display a string of ID numbers (of the items being arranged) sorted according to their order in the page, separated by a semi-colon.
I want to be able to save the string on the database and the use php explode to echo them correctly.
Below is the javascript that puts the ID numbers into a string:
<script type="text/javascript">
/* The saveData function creates a string containing the ids of your dragable elements.
The format of this string is as follow
id of item 1;id of item 2;id of item 3
i.e. a semi colon separated list. The id is something you put in as "id" attribute of your dragable elements.
*/
function saveData()
{
var saveString = "";
for(var no=0;no<dragableObjectArray.length;no++){
if(saveString.length>0)saveString = saveString + ';';
ref = dragableObjectArray[no];
saveString = saveString + ref['obj'].id;
}
alert(saveString); // Create pop-up dialog box - For demo only
}
</script>
as you can see, the "saveString" is the string that contains the IDs. I just need to convert the "saveString" to a php variable ($savestring) so I can save it to the database and use Php explode to display the items correctly.
Please help. Thanks!