How to trigger a postback using JQuery Droppable plugin ?
- by Sandeep K Ram
Hi,
This is my script for the draggable and droppable
<script type="text/javascript">
$(function() {
$(".Source li").draggable({
appendTo: "body",
helper: "clone",
revert: "invalid"
});
$(".Destination ").droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
accept: ".Source li",
drop: function(event, ui) {
$(this).find(".placeholder").remove();
$("#Hf1").val(ui.draggable.text());
$("#TxtItemId").val($("#Hf1").val());
}
});
});
</script>
Now I want to access the value of the "TxtItemId" control in the code-behind through a postback. How do I go about doing this ?
BTW, this is for a scenario where a person will drag an item from a panel into a shopping cart and I need to capture the Id of the dropped item and trigger a postback after the drop to update the quantity of that item in the cart.