I'm actually trying to create a .php page where I will have 3 draggable items that need to be dragged into 3 items with the option to be deleted - each one dragged to droppable and they are unique, so each one can only accept a specific draggable one.
The thing is, I need to control that all the elements were dragged to the right place, in which case I have to redirect the user, for example, to success.php, otherwise, if some elements were dragged to the wrong droppable, the user should go to, e.g. fail.php.
Is it possible, for example, to save a certain value in $ _SESSION in PHP to find out that all the dragged objects were deleted in the right place?
This is the code for drag & drop:
$(function() {
$("#draggableLeiden").draggable();
$("#draggableTheHague").draggable();
$("#draggableRotterdam").draggable();
$("#droppableLeiden").droppable({
accept: '.imgLeiden',
drop: function(event, ui)
{
$(this).addClass('ui-state-highlight');
}
});
$("#droppableTheHague").droppable({
accept: '.imgTheHague',
drop: function(event, ui)
{
$(this).addClass('ui-state-highlight');
}
});
$("#droppableRotterdam").droppable({
accept: '.imgRotterdam',
drop: function()
{
$(this).addClass('ui-state-highlight');
}
});
});
, , droppable, , "ui-state-highlight", , ,
drop: function()
.
!