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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:36:37+00:00 2026-06-12T09:36:37+00:00

I wrote the following code creating a popup with dynamic added content. Now I

  • 0

I wrote the following code creating a popup with dynamic added content. Now I want to delete these added items or edit them, but it didn’t seem to fire an event clicking one of those buttons (btnLSM_Remove + btnLSM_Edit). Any clues why it is so? btnLSM_Add and btnLSM_Okay work the same way and they do work…

function ListManagementDialog(obj, dialogTitle, dialogText, listDelimiter, btnNames) {
    if (!$.isArray(btnNames)) {        
        return false;
    }

     if (dialogConfirmed) {
        return false;
    }

    btns[btnNames[0]] = function () {
        $(this).dialog('close');
        dialogConfirmed = true;
        if (obj) {
            obj.click();
        }
    };

    btns[btnNames[1]] = function () {
        $(this).dialog('close');
    };



    $('body').append(String.Format('<div id="divLSM_Dialog" title="{0}"><p>{1}</p>' +
        '<button id="btnLSM_Add" class="btnAdd" type="button" role="button" aria-disabled="false" title="Hinzuf&#252;gen" />' +               
        '<input id="txbLSM_Emailadresse" class="text ui-widget-content ui-corner-all" type="text" name="txbLSM_Emailadresse" style="display:none;">' +
        '<button id="btnLSM_Okay" class="btnOkay" type="button" role="button" aria-disabled="false" title="&#220;bernehmen" style="display:none;" />' +
        '<br /><br />' +
        '<table id="tblLSM_Items" class="ui-widget ui-widget-content">' +
                 '<thead>' +
                        '<tr class="ui-widget-header ">' +
                '<th>Emailadresse</th>' +
                '<th />' +
                '</tr>' +
            '</thead>' +
            '<tbody />' +
        '</table>' +
        '</div>', dialogTitle, dialogText));

    $('#btnLSM_Add').click(function () {
        $('#txbLSM_Emailadresse').val('');
        $('#txbLSM_Emailadresse').show();
        $('#btnLSM_Okay').show();
        $('#txbLSM_Emailadresse').focus();
    });  

    $('#btnLSM_Okay').click(function () {
        $('#tblLSM_Items tbody').append('<tr>' +
            '<td>' + $('#txbLSM_Emailadresse').val() + '</td>' +
            '<td>' + '<button id="btnLSM_Remove" class="btnRemove" type="button" role="button" aria-disabled="false" title="Entfernen" />' + '<button id="btnLSM_Change" class="btnEdit" type="button" role="button" aria-disabled="false" title="&#196;ndern" />' + '</td>' +
            '</tr>');

        $('#txbLSM_Emailadresse').hide();
        $('#btnLSM_Okay').hide();
    });

    $('#btnLSM_Remove').click(function () {
        alert("hohoho"); //no alert-popup
    });   

     $('#btnLSM_Change').click(function () {
        alert("hohoho"); //no alert-popup
    });

    $('#divLSM_Dialog').dialog({
        modal: true,
        resizable: false,
        draggable: true,
        width: 600,
        height: 300,
        close: function (event, ui) {
            $('body').find('#divLSM_Dialog').remove();
        },
        buttons: btns
    });

    return dialogConfirmed;
}
  • 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-12T09:36:38+00:00Added an answer on June 12, 2026 at 9:36 am

    Your btnLSM_Remove button doesn’t exist when you call

    $('#btnLSM_Remove').click(function () {
    

    So the $('#btnLSM_Remove') collection is empty and the handler is added to nothing.

    You may use the on function:

    $('#divLSM_Dialog').on('click', '#btnLSM_Remove', function () {
    

    to register an handler that will apply to a button appearing after the delegation definition.

    EDIT :

    In jQuery 1.6.2, you may use live :

    $('#btnLSM_Remove').live('click', function () {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i wrote following code to create a linkbutton programmatically, but its showing like lable
I wrote following code...but i am getting Error like: Error 1 'LoginDLL.Class1.Login(string, string, string)':
I wrote the following code for text file encryption and decryption. The encryption process
I wrote the following code to select text from database,but when i echo the
if wrote the following code and do not understand why the trace returns false:
I wrote the following code: import java.lang.*; import DB.*; private Boolean validateInvoice(String i) {
I wrote the following code snippet in VS2010: #pragma once #include stdafx.h #ifndef SECURITY_WIN32
I wrote the following code to count the node of an XML file: private
I wrote the following code to rotate a cube on x axis an entire
I'm working with the jQuery Validation plugin and I wrote the following code 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.