Q: Can I send to post a re-ordered serialized sorted list without using AJAX? I just want to sort a list on a page and submit which will provide a string with the items in the order they were last sorted. Then i'll do my work with it. I read it's doable without AJAX but I can't find any examples that actually do it without.
Below is the code, this works for sorting but i'm not really sure how to get the elements from the UL after the post. The echo of $test already doesn't return the value first of all, and if I do manage it, i'm not actually sure how to get all items in the order that it's posted in a string. (considering my current echo defeats the purpose of the sort, mostly to see if i'm catching the value at all).
Any tips?
EDIT: Solved by using hidden inputs inside the LI list and then just printing the array it gives me will come out in the correct order.
<?php
    if($_SERVER['REQUEST_METHOD'] == 'POST'){
        $test = $_POST['1'];
    echo $test;
    echo 'we in here';
    }
?>                                      
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>  
<script>
 $( function() {
 $( "#sortable" ).sortable();
 $( "#sortable" ).disableSelection();
 $( "#sortable").serialize();
  } );
  </script>
<form method='post'>
<ul id="sortable">
  <li name='1' class="ui-state-default">Item 1</li>
  <li name='2'class="ui-state-default">Item 2</li>
  <li name='3' class="ui-state-default">Item 3</li>
</ul>   
<button type="submit">Submit</button> 
</form>

