Get value array from JQuery droppable

Posted on 2009-02-10
Last Modified: 2012-05-06
How can I retrieve array value from jquery droppable div?
Question by:edyonline
    LVL 11

    Expert Comment

    Are you asking for the index of the droppable set?

    If my assumption is off base, you will have to be a bit more descriptive of what you want.

    I haven't tested it out so if this doesn't get you on the right track, let me know and I'll put together an actual working example (I don't have jqueryUI installed ATM). Hopefully this helps before I get a chance to make a proper example anyway. I think it would work something like this:

    var droppedIndex = null;
       drop: function(event, ui) { droppedIndex = $('DIV.droppables').index(this); }

    Open in new window


    Accepted Solution

    for example, i want to create drag and drop shopping cart. how can i know all the item that i dropped to the shopping cart?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
    Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
    The viewer will learn how to dynamically set the form action using jQuery.
    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)

    779 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

    10 Experts available now in Live!

    Get 1:1 Help Now