Hi all,
I am trying to convert a PHP/JQuery sortable drag and drop script. I want to add JQuery sortable functionality to a site I have that is written in Classic ASP.
Here is a scaled down version of the script:
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.1.custom.min.js"></script>
<script type="text/javascript">
// When the document is ready set up our sortable with it's inherant function(s)
$(document).ready(function() {
$("#test-list").sortable({
handle : '.handle',
update : function () {
var order = $('#test-list').sortable('serialize');
$("#info").load("process-sorttest.asp?"+order);
alert('' + order);
}
});
});
</script>
<li id="listItem_1"><img src="img/arrow.png" alt="move" width="16" height="16" class="handle" /><strong>Item 1</strong></li>
<li id="listItem_2"><img src="img/arrow.png" alt="move" width="16" height="16" class="handle" /><strong>Item 2</strong></li>
The Jquery sortable side of the script works perfect. My problems accur trying to save the updated data back to the database.
Here is the PHP version of the script that I would like to convert to ASP:
foreach ($_GET['listItem'] as $position => $item) :
$sql[] = "UPDATE `table` SET `position` = $position WHERE `id` = $item";
endforeach;
print_r ($sql);
This is the closest I can get in classic asp:
For Each Item In Request.QueryString
Response.write "Processing: " & Request.QueryString("listItem[]") & "<br />"
Next
This gives me the ID's of the menu item I am modifiying however the reason I want to convert this script is because the PHP script reads and prints both the new order of the sort and the ID of the list item. All that my asp prints are the ID of the list items "Processing 1, 2"
Any help would be greatly appreciated..