Save the contents of manipulated div to a variable and pass to php file

Posted by Danielle Zarcaro on Stack Overflow See other posts from Stack Overflow or by Danielle Zarcaro
Published on 2013-06-29T16:16:40Z Indexed on 2013/06/29 16:21 UTC
Read the original article Hit count: 177

Filed under:
|
|
|

I have tried to use AJAX, but nothing I come up with seems to work correctly. I am creating a menu editor. I echo part of a file using php and manipulate it using javascript/jquery/ajax (I found the code for that here: http://www.prodevtips.com/2010/03/07/jquery-drag-and-drop-to-sort-tree/). Now I need to get the edited contents of the div (which has an unordered list in it) I am echoing and save it to a variable so I can write it to the file again. I couldn't get that resource's code to work so I'm trying to come up with another solution.

If there is a code I can put into the $("#save").click(function(){ }); part of the javascript file, that would work, but the .post doesn't seem to want to work for me. If there is a way to initiate a php preg_match in an onclick, that would be the easiest.

Any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript