Grab click event of a checkbox added with prepend

Grab click event of a checkbox added with prepend

dynasoftdynasoft Posts: 338Questions: 54Answers: 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: 9,077Questions: 0Answers: 1,520
    Answer ✓

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

    Colin

  • dynasoftdynasoft Posts: 338Questions: 54Answers: 3
    edited February 11

    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: 338Questions: 54Answers: 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: 9,424Questions: 25Answers: 2,167

    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: 338Questions: 54Answers: 3

    Thank you. That worked well.

Sign In or Register to comment.