[eluser]Chris Newton[/eluser]
I'm using jQuery's 'sortable' function, and I can't get anything to happen with the onchange part of the function for the life of me. I've tried stripping out all of the ajax code just for sure, but the onchange function still doesn't seem to fire. I can provide more code, but I thought maybe there was some simple piece of jQuery code that I have screwed up somewhere. The 'sortable' function works-ish... that is, the fields that are supposed to be rearrangable can be rearranged, I just can't use that rearranged order for anything else.
Code:
$(document).ready(function(){
$("#sortable_message_fields").sortable({
containment: 'document',
accept: "sort_item",
onchange: function(sorted){
serial=$('#sortable_message_fields').sortable('serialize');
$.ajax({
url:"<?=base_url().'ajax/reorder_text_inputs'?>",
type:"POST",
data:serial.hash,
complete:function(feedback){$("#data_panel").html("complete");},
success:function(feedback){$("#data_panel").html(feedback);},
error:function(feedback){$("#data_panel").html("error");}
});
}
});
});
Any help would be greatly appreciated.