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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:32:32+00:00 2026-05-27T07:32:32+00:00

When appending HTML from a JSON reply, the event handlers appear to lose their

  • 0

When appending HTML from a JSON reply, the event handlers appear to lose their event bindings. In using the .live() function the handler now appears to work.

$.each(result[0], function(i,wellList) {
    $jsonResult = wellList["@name"];
    $uid = wellList["@uid"];
    $dynamicCheckBoxDiv += '<input type="checkbox" name="checkbox-1" value="'+ $uid
        + '" class="wellCheck" id="checkbox-'+i+'" />' +
        '<label for="checkbox-'+i+'">' + $jsonResult + '</label>';              
});
$dynamicCheckBoxDiv += '</fieldset></div>';

//Append results to div
$("#dynamicCheck").append($dynamicCheckBoxDiv).page();

$(".wellCheck").live('click', (function() {

This event now fires when the click function is run. However, after clicking the checkbox a few times, it randomly associates the checks with the wrong boxes and starts to fire the click event fire on a single click. Has anyone seen this before?

Also: How could I add a method to check all the boxes in a separate button? Since they are being added dynamically it seems to just bypass this function:

// When select No wells is clicked this method is run
$('#selectNone').click(function() {
    $('#dynamicCheck .wellCheck').find(':checkbox').attr('checked', 'checked');
});

It enters the method, but doesnt seem to check any of the boxes. I have jQuery and jQuery mobile added to this page and both methods exist under document.ready.

  • 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-27T07:32:33+00:00Added an answer on May 27, 2026 at 7:32 am

    You don’t need to find(":checkbox") since the .wellCheck element is the checkbox. Just do this:

    $("#selectNone").click(function(){
        $("#dynamicCheck .wellCheck").prop("checked", true);
    });
    

    Demo.

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

Sidebar

Related Questions

I'm having trouble appending the values from a list of lists into a html
I have 464 JSON objects. An HTML element needs to be generated from each
I am appending code to a div block from a partial using unobtrusive javascript.
I am trying to create a JSON object from a bunch of grouped HTML
When appending to a file using Windows batch commands, how to append immediately after
Can anyone point me in the right direction. I am appending an HTML element
Well I use a script that get a external JSON from a file, and
I have been looking at a HTML 5 boilerplate template (from http://html5boilerplate.com/ ) and
I'm creating a dropdown box dynamically in jQuery by appending html as follows: .append(<br><SELECT
I receive an html like that below from a server. I rebuild the textual

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.