Getting 'Undefined' error when requesting element id of sortable object.
Hi, I have been looking through the forums and this question has popped up but none of the solutions work. I know I must be doing something wrong but cannot spot it. The code shown below is supposed to alert me the id when the the object is sorted. The update trigger is fine, but I keep getting the message the the id is undefined.
$(function () {
$("#sortsectiona, #sortsectionb, #sortsectionc").sortable({
connectWith: ".connected",
scroll: false,
revert: true,
update: function (event, ui) {
var id_element = $(ui.item).attr('id');
alert(id_element);
}
}).disableSelection();
});
I would appreciate any help you can give me.