Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8790795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:44:57+00:00 2026-06-13T22:44:57+00:00

In my script I’m experimenting with jquery draggable & droppable, See here . I’m

  • 0

In my script I’m experimenting with jquery draggable & droppable, See here. I’m trying to grab the data (to eventually put in a database) from each draggable element that’s dropped into the droppable div. Right now I have it so that I can only get the data from the div the was last dropped.

    $('#sortcard, #dropbox, #dropbox1').droppable({
        accept: '.sorting',
        hoverClass: 'border',
        tolerance: 'touch',
        drop: function(e, ui) {
          $(this).append(ui.draggable.html() + '<br/>');
          $("#add_friend").show().fadeOut(12000);
          $(e.target).droppable("disable");
          $(e.target).append("<input type='button' name='Sub' value='clear'/>").click(function() {
            $(this).empty().droppable("enable");
             });

            var dropbox = $('#dropbox').html();
            var dropbox1 = $('#dropbox1').html();

            if(dropbox && dropbox1 !== '') {
                 $.post("account_main.php", {data: $(this).text()}, function(data) {
                    $('#demo').html(data);
                });     
             }
          }
      });

I’m thinking the culprit may be

{data: $(this).text()}, function(data) {
    $('#demo').html(data);
});     

I have toyed with it and still not getting the results I desire. I feel maybe my coding on this is sketchy and needs a makeover, but I just need some ideas to push me in the right direction to make it efficient and would be very appreciative as well of any tips.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:44:59+00:00Added an answer on June 13, 2026 at 10:44 pm

    You’re only getting the data from the last droppable because your sending $(this).text().

    In that context $(this) is the last droppable that was dropped. Since you want more than that, you’ll want to replace:

    {data: $(this).text()}
    

    with something like:

    {
        sortcard: $('div#sortcard').text(),
        dropbox: $('div#dropbox').text(),
        dropbox1: $('div#dropbox1').text()
    }
    

    Which will send the data from those three DIVs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Script link on master page: <head runat=server> <script src=<%=ConfigurationManager.AppSettings[ApplicationURL].ToString()%>Scripts/jquery-1.7.2.js type=text/javascript language=javascript></script> </head> Default.aspx page
The script is on jsfiddle here : CODE What it does at the moment
Script (originally copied from here ) takes a fixed-width text file as input, rearranges
Script for table and sample data CREATE TABLE #TEMPTABLE1(ID INT, COL1 NVARCHAR(10)) CREATE TABLE
my script is using utf8_general_ci and im trying to transfer to another script that
Script registrar loads jquery.validation.min.js even after Html.Telerik().ScriptRegistrar().jQuery(false) Is there any way to tell it
The script for mysql database is as follow: Create Table Aircraft ( aid integer
This script extracts data from check boxes in order to determine the information a
Script: http://keith-wood.name/countdown.htm Daily json response: items: { fajr: '5:23 am', sharooq: '7:23 am', dhur:
Following Script isn't working in CHROME browser, IE is Fine. I've changed opener.document ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.