Grab click event of a checkbox added with prepend

Grab click event of a checkbox added with prepend

dynasoftdynasoft Posts: 248Questions: 40Answers: 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.

Answers

  • colincolin Posts: 7,598Questions: 0Answers: 1,285

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

    Colin

  • dynasoftdynasoft Posts: 248Questions: 40Answers: 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: 248Questions: 40Answers: 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: 7,697Questions: 24Answers: 1,706

    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: 248Questions: 40Answers: 3

    Thank you. That worked well.

Sign In or Register to comment.