How to get clicked indeterminate checkboxes to 'checked' state
<p>I have tried to follow this thread that suggests a solution to <a href="http://stackoverflow.com/questions/14625719/what-can-i-use-instead-of-the-indeterminate-jquery-selector-to-avoid-an-excepti">check indeterminate states</a>.</p>

<p>I am using ASP.NET, and it seems that clicking a checkbox in indeterminate state will uncheck it, and not fire any event (the underlying checkbox is actually 'unchecked'). I was thinking of having Javascript check it for me when I click a checkbox that is in indeterminate state (prefer the logic this way, and that should fire my ASP.NET event).</p>

<pre><code>$(document).ready(function () {
    $(".UndefinedCheckboxState :checkbox").prop("indeterminate", true);

    $(":checkbox").click(function () {
        if ($(this).prop("indeterminate")) {
            $(this).prop("indeterminate", false);
            $(this).prop("checked", true);
        }
    });
});
</code></pre>

<p><strong>UPDATE:</strong> The click event works fine, but the condition in the <code>if</code> is never true ! I keep clicking checkboxes in indeterminate state though...</p>
