PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Trigger Script On Checkbox Select

  1. Pierre-GF
    Member

    Hi, All. I'm new to Gravity Forms and love it. Have an issue I've been researching for a couple hours with no luck, so any help would be appreciated.

    I'm trying to trigger a count of checkboxes selected on the first page of a multipage form. Here's my code:`

    <div id="counter"></div>
    <script>
    function countChecked() {
    var n = $("input:checked").length;
    $("div#counter").text(n + (n <= 1 ? " is" : " are") + " checked!");
    }
    countChecked();
    $(":checkbox").click(countChecked);
    </script>`

    It works when I throw up a sample form with checkboxes above the gravity form, but when I remove the sample form so that only inputs from GF should trigger it, nothing happens.

    Any help would be appreciated.

    Thanks,

    Pierre

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink