Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple drag and drop in JQuery: event after dragging
    primarykey
    data
    text
    <p>I am actually trying to make a .php page where I am going to have 3 draggable elements which have to be dragged to 3 droppable elements -each draggable to a droppable, and they are unique, so one each droppable will only accept a certain draggable.</p> <p>The thing is that I need to control that all of the elements have been dragged to the right spot, in which case I should redirect the user for example to success.php, otherwise, if some of the elements were dragged to the wrong droppable, the user have to go to for example failure.php.</p> <p>Is there anyway for example to save a certain value in a $_SESSION in PHP in order to know that all the draggables have been dropped in the right place?</p> <p>This is the code for the drag&amp;drop:</p> <pre><code>$(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'); //var activeClass = $(this).droppable('option', 'activeClass','ui-state-highlight'); } }); }); </code></pre> <p>I am trying to do this for example getting the active class of the droppable elements to see if it matches 'ui-state-highlight', but actually, that tag is gonna be executed everytime the page reloads, so if I try to insert any code into the<br> drop: function() it will always execute.</p> <p>Thanks a lot in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload