Link to home
Start Free TrialLog in
Avatar of jdav357
jdav357

asked on

JQuery Drag and Drop

Hi,
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?
Cheers
John
Avatar of Nithyanandhan_T
Nithyanandhan_T
Flag of United States of America image

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!!
Avatar of jdav357
jdav357

ASKER

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


John
ASKER CERTIFIED SOLUTION
Avatar of Nithyanandhan_T
Nithyanandhan_T
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial