Jump to content

Drag and drop menu


Canman2005

Recommended Posts

I've managed to add in the following to that code

 

<script>
function ajaxLoader(url,id) {
  if (document.getElementById) {
    var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
  }
  if (x) {
    x.onreadystatechange = function() {
el = document.getElementById(id);
        el.innerHTML = "";

      if (x.readyState == 4 && x.status == 200) {
        el = document.getElementById(id);
        el.innerHTML = x.responseText;
      }
    }
    x.open("GET", url, true);
    x.send(null);
  }
}
</script>
<script>
$(document).ready(function(){

$("ul.sortable").tree({
dropOn: ".item_name",
placeholder: 'placeholder',   
tabSize: 20, 
maxDepth: 2,
maxDepthError: 'ui-tree-deptherror',
maxDepthErrorText: 'Only three levels are alowed!',
maxItems: [7], 
maxItemsError: 'ui-tree-limiterror', 
maxItemsErrorText: 'You have reached the maximum number of items for this level!'
});

$("#serializebtn").click(function(){
 var sorte = $("ul.sortable").tree("serialize");
 ajaxLoader('update.php?action='+sorte+'','content'); 
});

});
</script>
<span id="content"></span>

 

which posts to a database when the

 

<a href="#" id="serializebtn">serialize</a>

 

link is clicked.

 

but it is only inserting

 

list[]=1

 

into the database.

 

how can I get it to post the correct data?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/176301-drag-and-drop-menu/#findComment-929632
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.