Grab click event of a checkbox added with prepend

Grab click event of a checkbox added with prepend

dynasoftdynasoft Posts: 422Questions: 67Answers: 3

Hi

I have added a checkbox with the prepend method to an editir form. what is the correct syntax for grabing the click event. Tried these but they won't work:

         $('input:checkbox').on('click', function () {
             alert('aaa');
         });

        $("#chkDoNotInsertDistributorPOSCommission").click(function () {
             alert('aaa');
        })

I tried looking on the forum but couldn't find anything. Thanks.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Could you modify this to demonstrate the issue, please. It'll help to understand.

    Colin

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3
    edited February 2020

    Hi, thanks. Here's a modified example. I just need to grab the click event for chkDoNotInsertDistributorPOSCommission

    http://live.datatables.net/wegowafu/126/

    Select a line and hit edit button. The checkbox is at bottom of form.

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3

    There's a bizarre behviour by the forum whenever I post something a new comment box appears with each post. see screenshot.

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    I just need to grab the click event for chkDoNotInsertDistributorPOSCommission

    Do you mean like this?
    http://live.datatables.net/zotivasu/1/edit

    I post something a new comment box appears with each post

    I've seen this when editing posts.

    Kevin

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3

    Thank you. That worked well.

This discussion has been closed.