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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:12:20+00:00 2026-06-13T21:12:20+00:00

I am trying to impliment the IN Place Editing functionality using JQuery. Here is

  • 0

I am trying to impliment the IN Place Editing functionality using JQuery.
Here is the code
editinplace.js

$(document).ready(function() {
    //When div.edit me is clicked, run this function
    $("div.editme").click(function() {
        //This if statement checks to see if there are 
        //and children of div.editme are input boxes. If so,
        //we don't want to do anything and allow the user
        //to continue typing
        if ($(this).children('input').length == 0) {

            //Create the HTML to insert into the div. Escape any " characters 
            var inputbox = "<input type='text' class='inputbox' value=\""+$(this).text()+"\">";

            //Insert the HTML into the div
            $(this).html(inputbox);

            //Immediately give the input box focus. The user
            //will be expecting to immediately type in the input box,
            //and we need to give them that ability
            $("input.inputbox").focus();

            //Once the input box loses focus, we need to replace the
            //input box with the current text inside of it.
            $("input.inputbox").blur(function() {
                var value = $(this).val();
                $(".editme").text(value);
            });
        }
    });



});

ButtonClickFunction.js

function ADDRADIOBUTTON(){

    //Creating the div Tag
    var answer_div = document.createElement("div");
    answer_div.setAttribute("class", "answer"); 
    answer_div.id = "answer_div_"+counter;

    // Creating the Radio button tag
    var answer_tag = document.createElement("input");
            answer_tag.setAttribute("type", "radio");
            answer_tag.id = "answer_tag_"+counter;
            answer_tag.setAttribute("name", answer_div.id);

                // Creating the Label Tag
    var radio_label_tag = document.createElement("label");
    radio_label_tag.setAttribute("for", answer_tag.id);

                //Creating the label        
    var In_Place_Edit_div = document.createElement("div");
        In_Place_Edit_div.setAttribute("class", "editme"); 
        var In_Place_Edit = document.createTextNode("label");
    In_Place_Edit_div.appendChild(In_Place_Edit);

         radio_label_tag.appendChild(In_Place_Edit_div);

            // Adding Radio button dot on the div and screen actually       
            answer_div.appendChild(answer_tag);

            //Adding the Label here on the right of radio button.
            answer_div.appendChild(radio_label_tag);


    // Adding Answer div to the main div        
    var element=document.getElementById("divid_"+counter);
    element.appendChild(answer_div);


}

and the index.php file includes these two JS files along with jquery-1.8.2.min.js

<script language="javascript" src="js/jquery-1.8.2.min.js"></script>
<script language="javascript" src="js/editinplace.js"></script>
<script type="text/javascript" src="js/ButtonClickFunction.js"></script>

What I am trying to do is create a radio button with label besides it and the label can be edited when we click on it. Now the problem here is that when I use the Code

<div class="editme">Please click me!!</div>

directly in the index.html page it works fine but when I try to generate the same line of code dynamically as I shown in ButtonClickFuction.js file it Does not work. What might be the problem ?

  • 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-13T21:12:21+00:00Added an answer on June 13, 2026 at 9:12 pm

    After crerating the HTML element dynamically you must bind the click function once more.Otherwise it wont work.Just call the click function after dynamic creation of the
    < div class=”edttime”>Please click me!!.Otherwise click wont work for the newly created div with class edttime.

     $("div.editme").click(function() {
        //This if statement checks to see if there are 
        //and children of div.editme are input boxes. If so,
        //we don't want to do anything and allow the user
        //to continue typing
        if ($(this).children('input').length == 0) {
    
            //Create the HTML to insert into the div. Escape any " characters 
            var inputbox = "<input type='text' class='inputbox' value=\""+$(this).text()+"\">";
    
            //Insert the HTML into the div
            $(this).html(inputbox);
    
            //Immediately give the input box focus. The user
            //will be expecting to immediately type in the input box,
            //and we need to give them that ability
            $("input.inputbox").focus();
    
            //Once the input box loses focus, we need to replace the
            //input box with the current text inside of it.
            $("input.inputbox").blur(function() {
                var value = $(this).val();
                $(".editme").text(value);
            });
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement edit in place functionality for a description field, where editing
I'm trying to implement a queue using an array. Here is my code: #include
I am trying to implement some ajax functionality in my Symfony 2 project. Using
I'm trying to implement cookies in my website, I'm using jquery, but I can't
I am currently trying to implement some code using Android to detect when a
Using PHP, and MySql, I am trying to implement this rather snazzy in-place editor
Trying to implement a search similar to here .This searches properties based on city,locality,property
I'm trying to implement an API that performs some really lengthy tasks using a
I am trying to implement a function in Django to upload an image from
I am trying to implement UICollectionView and show images. I am using SDWebimage which

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.