Basic form validation script
The if statements could be cleaner:

    if ($("input:checkbox").length &gt; 0 &amp;&amp; $("input:checkbox:checked").length == 0)
    {
        shouldSubmit = false;
    }

    if ($("input:radio").length &gt; 0 &amp;&amp; $("input:radio:checked").length == 0)
    {
        shouldSubmit = false;
    }

    if (!shouldSubmit)
    {
        alert("All form fields must be filled out.");
    }