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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:35+00:00 2026-05-23T13:00:35+00:00

I have a drag and drop functionality for form elements. The structure of the

  • 0

I have a drag and drop functionality for form elements. The structure of the draggable element is

<div class="tools">
 <ul>
<li class="draggable" >
  <div class="control">
    <label>&nbsp;</label>
    <input type="text" name="txt" value="" />
    <span class="controlText"> Text Box </span>
    <div class="delete" style="display:none"><sup>x</sup></div>
    <div class="properties txtbox" style="display:none">Properties</div>
  </div>
</li>

The droppable area has the following code. The elements are added in this

<div class="editor">
<ul class="sortable" id="leftColumn">
<li style="visibility:hidden" class="ui-state-default">Test</li>
</ul>
</div><!-- editor -->

On dropping the delete and the properties are displayed with that element. Now when i click on the properties i get a dialog box through the following

 $('.txtbox').live('click', function() {
     //get the label
        var label = $(this).parent().find('label').html();
        $("#textbox_label").val(label);
        $( "#dialog-textbox" ).dialog( "open" );
        return false;
    }); 

while the dialog is

<div id="dialog-textbox" title="Text Box Properties" style="display:none">
 <p>This is the Text Box Properties Form.</p> 
 <form>
<fieldset>
  <label for="textbox_label">Enter Label </label>
  <input type="text" name="textbox_label" id="textbox_label" class="text ui-widget-content ui-corner-all" />
</fieldset>

Now what i am doing is when the user enters a value in the dialog form for the label it should be updated directly on the element and its label should be what the user has entered

The update code structure what i am doing is like

$("#dialog-textbox").dialog({
autoOpen: false,
height: 300,
                        width: 350,
                        modal: true,
                        buttons: {
                                "Apply": function(){
                                     //code to update element goes here...
                                    var label = $("#textbox_label").val()
                                    alert("New Label "+label);
                                    // here i need to access the item on which the user clicked                                     
                                    },
                                Cancel: function() {
                                            $( this ).dialog( "close" );
                                        }
                        }
                         });

How should i add a line in this update code so that the label is updated as the value entered by the user???

  • 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-23T13:00:36+00:00Added an answer on May 23, 2026 at 1:00 pm

    You could store the clicked object with .data(), like this:

       $('.txtbox').live('click', function() {
            ...
            $( "#dialog-textbox" ).data("elem_clicked", $(this)); //This stores
            $( "#dialog-textbox" ).dialog( "open" );
            return false;
        }); 
    

    Then, you can retrieve it like this:

    buttons: {
        "Apply": function(){
            ...
            var $elem_clicked = $("#dialog-textbox").data('elem_clicked'); //This retrieves
         },
      ...
     }
    

    As you can see, we’re storing the element clicked in the dialog with .data()

    Hope this helps. Cheers

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

Sidebar

Related Questions

i have a treview control with drag&drop functionality that response to draw the node
I have created a nested list with drag/drop functionality. My issue is that I
I have Drag/Drop functionality in my page embedded using YAHOO.js which is initalized at
I have some drag and drop functionality on my website, I am wanting to
I have an application that has drag and drop functionality to import images and
I have a drag-and-drop functionality in my application using DragDrop event and DoDragDrop method
I have a page where I need to add a drag and drop functionality
In one of our application we have to implement item drag/drop functionality on the
I have a Silverlight application that needs Drag-And-Drop functionality because I allow the user
I am looking to implement the drag and drop functionality in flex. I have

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.