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

  • Home
  • SEARCH
  • 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 7947703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:30:33+00:00 2026-06-04T01:30:33+00:00

i think the title is pretty self explanatory. I have many divs generated from

  • 0

i think the title is pretty self explanatory.
I have many divs generated from php code that take products from database.
the problem is when i drag them between two containers(also divs) i cant return all of them back to the first container because the products div id is same and it takes it as repeat from container 1 –> 2 and not backwards from contaner 2 –> 1.(2 containers have and all product divs have same id).
i can solve this by adding +1 to the divs id of the products(so they have different id) but that way i cant use the id from the css. Any solution?
here is the js code

<script type="text/javascript">
            function allowDrop(ev){
                ev.preventDefault();
                }
            function drag(ev){
                ev.dataTransfer.setData("Text",ev.target.id);
                }
            function drop(ev){
                if (ev.target.id == "container"){
                var data=ev.dataTransfer.getData("Text");
                ev.target.appendChild(document.getElementById(data));
                ev.preventDefault();
                }}
        </script>

thanks in advance

  • 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-04T01:30:35+00:00Added an answer on June 4, 2026 at 1:30 am

    i have solved this by using incremented id for the div generated by php. how ever tha was not one of the solutions i wanted.
    thanks for trying to help

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

Sidebar

Related Questions

I think the title is self explanatory. What I'm looking for is material so
I think the title is fairly self explanatory, but to give a little context.
The title pretty much says it all. I have a project that for political
I believe the title is pretty self-explanatory but still, maybe, I should ask in
I think the title is rather self explanatory but just to clarify I am
I think that the title pretty much sums it up: What's the difference between
I think the title is pretty clear. I have ran into this twice now.
The title is pretty self explanatory. Here's the function I've written for this purpose:
OK, I don't think the title says it right... but here goes: I have
The title says enough I think. I have a full quality BufferedImage and I

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.