JQuery Drag and Drop

Posted on 2009-12-30
Last Modified: 2012-05-08
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?
Question by:jdav357
    LVL 3

    Expert Comment

    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!!
    LVL 2

    Author Comment

    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

    LVL 3

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Android App Development

    This course will involve creating widgets, customize list view, grid view, spinners, etc. Creating applications using audio, video, and SQLite database. Ending with publication on Google Play.

    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now