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 6925639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:48:56+00:00 2026-05-27T10:48:56+00:00

I am trying to make a form building tool. Everything was working just fine.

  • 0

I am trying to make a form building tool. Everything was working just fine. I was able to drag my first icon and drop it on the main form body, just fine. When I do this, it appends a new div of class panel. I make panel droppable as well, however when I try to drop something on it nothing happens. If I hard code the div in it works fine, however when I append the div it does not. I’m having a lot of trouble figuring this out.

Here’s my code:

<html>
<head>

<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.16.custom.min.js"></script>

<style type="text/css">
    #toolbox
    {
        width: 100%;
        height: 200px;
        position: fixed;
        top: 0;
        left: 0;
        background-color: #666666;
        z-index: 2;
    }
    .icon
    {
        padding-top: 20px;
        padding-left: 20px;
        text-align: center;
        display: table-cell;
    }
    #formbuilder
    {
        width: 100%;
        position: absolute;
        top: 200px;
        left: 0px;
        bottom: 0px;
        padding-top: 5%;
        background-color: orange;
        opacity: 0.4;
        overflow: visible;
    }
    .panel
    {
        margin: 0 auto;
        margin-bottom: 20px;
        height: 150px;
        width: 150px;
        background-color: blue;
        opacity: 0.4;
    }
</style>

</head>

<body>

    <script type="text/javascript">
        function formDropHandler(event, ui)
        {
            if(ui.draggable.hasClass("pan"))
            {
                var form = $("#formbuilder");
                form.append('<div class="panel ui-droppable"></div>');

                $(".panel").droppable({
                    drop: panelDropHandler
                });
            }
        }

        function panelDropHandler(event, ui)
        {
            if(ui.draggable.hasClass("tab")) alert("TRUE");
        }

        $(document).ready(function() {
            var icons = $('.icon');

            $('.icon').draggable({
                cursor: 'move',
                helper: 'clone',
                revert: true
            });

            $("#formbuilder").droppable({
                drop: formDropHandler
            });

            $(".panel").live('mouseover',function(){
                $(".panel").droppable({
                    drop: panelDropHandler
                });
            });
        });
    </script>

    <div id="toolbox">
        <div class="icon pan">Panel<br /><img src="panel.png" alt="PANEL.PNG" /></div>
        <div class="icon tab">Table<br /><img src="table.png" alt="TABLE.PNG" /></div>
    </div>

    <div id="formbuilder">
        <div class="panel"></div>
        <div class="panel"></div>
    </div>

</body>

</html>
  • 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-05-27T10:48:57+00:00Added an answer on May 27, 2026 at 10:48 am

    Try this. Both drops are working now. The panel drops on the form builder and the table drops on the panels, (even the newly created ones). Just remember that the formbuilder is only the area that is colored in under the toolbar section. So the further you go down you won’t be able to drop anything unless you scroll back up. But that’s just a simple matter of CSS, change the position:absolute to position:relative and it should grow with the panels.

    function formDropHandler(event, ui) {
        if (ui.draggable.hasClass("pan")) {
            var form = $("#formbuilder");
            form.append('<div class="panel ui-droppable"></div>');
        } else if (ui.draggable.hasClass("tab")){
           alert("TRUE");
        }
    }
    
    $(document).ready(function() {
        var icons = $('.icon');
    
        $('.icon').draggable({
            cursor: 'move',
            helper: 'clone',
            revert: true
        });
    
        $("#formbuilder").live('mouseover', function() {
            $("#formbuilder").droppable({
                drop: formDropHandler
            });
        });
        $(".panel").live('mouseover', function() {
            $(".panel").droppable({
                drop: formDropHandler
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to make a c# WPF form where i can drag it
I'm working with a GUI in PowerShell and trying to make the form such
OK. I just tied myself in a knot trying to make a form in
I am trying to make form submit with TAB button. It is working on
ive been trying to make a form with drop downs which are populated from
I am trying to make a form in which the user fills in values.
I'm trying to make a form invisible for x amount of time in c#.
I am trying to make a form move (using the titlebar) from a button
I am trying to make a form field for a datetime property that allows
I'm trying to make an AJAX form that will update a twitter status when

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.