• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

JQuery Drag and Drop

I want to use JQuery drag and drop ui component. I want to give each div an id. Is there a way that I can detect in PHP the Divs that have been dropped on to a certain area?
  • 2
1 Solution
You cannot directly handle the drag/drop events in PHP.. because event will be in client side while PHPs scope is only in the server side.

Instead, you can catch those events in JQuery and make server side call to trigger corresponding PHP.

You can make PHP / any server side  call using AJAX(JQuery has functions to handle AJAX calls aswell.. it will make your job easy).

You can also make normal HTTP call to trigger your PHP class... but usually for these kind of scenario AJAX will be more suitable..

let me know if it helps!!
jdav357Author Commented:
I know what you mean, I am just not sure how to implement it. The effect I am trying to achieve is a user can select different objects they want by moving them from one place to another, when they move it the event will save the users preference.

Do you know of any links etc, which could point me in the right direction?

Many thanks for your help

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now