Note that there are some explanatory texts on larger screens.

plurals
  1. POclick event not triggering
    text
    copied!<p>I'm not sure why this code doesn't work. It may be because the checkbox is on a coldfusion div page. When the checkbox is clicked, I want to update the individuals record.</p> <p>The ReInitialize function works when I click on that button. The code to zebra stripe the table works on initial form load, but not on subsequent loads when it posts to itself. The checkbox click function never gets hit. I can set a breakpoint in Firebug and it never stops.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $('#ReInitialize').click(function () { var ReInitAnswer = confirm('Are you sure you want to start over from scratch?'); if (ReInitAnswer) { $.ajax({ type: "POST", url: "cfc/basic.cfc?method=TruncateTemp", error: function (xhr, textStatus, errorThrown) { // show error alert(errorThrown); } /* , success: function (msg) { alert("Data Saved: " + msg); } */ }); $('#ReInitialize').attr('checked', true); } else { alert('canceled'); } }); var table = $('#articles'), rows = table.find('tr'), cells, background, code; for (var i = 0; i &lt; rows.length; i += 1) { cells = $(rows[i]).children('td'); code = $(cells[0]).value(); if (code % 2 == 0) { background = '#e29e6e'; } else { background = '#f9cf80'; } $(rows[i]).css('background-color', background); } $('.notdupe').bind('change', function () { // &lt;---------------------- // If checked if ($(this).is(":checked")) { $.ajax({ type: "POST", url: "cfc/basic.cfc?method=SetNotDupe", data: "indivNum=" + $(this).value() + "&amp;SetValue=" + $(this).checked(), error: function (xhr, textStatus, errorThrown) { // show error alert(errorThrown); } }); } }); }); &lt;/script&gt; &lt;cfif qPages.not_dupe_flag&gt; &lt;input class="notdupe" type="checkbox" name="indivID" value="#userid#" checked /&gt; &lt;cfelse&gt; &lt;input class="notdupe" type="checkbox" name="indivID" value="#userid#" /&gt; &lt;/cfif&gt; </code></pre> <p>I changed it from a click event to a change event.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload