I have a page using HTML 5 drag and drop elements. When dropped into a container (div) it calls an ajax function
function drop(containerId, e) {
var id = event.dataTransfer.getData("id");
console.log(id);
$.ajax({
url: "dataworker.php",
type: "POST",
data: {
id: id,
containerid: containerId,
},
success: function() {
console.log('great success');
window.location.reload()
return true
}
});
}
function dragStart(e) {
console.log(e);
e.dataTransfer.setData("id", e.srcElement.id);
}
function allowDrop(e) {
e.preventDefault();
}
Is there a way to load a popup that allows the user to select one of many (up to 5) options pulled from a database (preferably php friendly)? I am hoping to be able to have the user select that data and post it to a different page BEFORE completing the drag action. or have a function to undo the drag if the user does not select an option