title: jQuery / JavaScript test for email && checkbox validation
body: <p>How do I test for form validation for both variables: emailAddr &amp;&amp; items[].</p>
  
  <p>items[] is a checkbox array.</p>
  
  <p>Currently the code below won't submit the form at all.</p>
  
  <pre><code>jQuery(document).ready(function(){
          var re = /(\w+)\@(\w+)\.[a-zA-Z]/g;
          var email = document.getElementById("emailAddr");
          var emailValue = email.value;
          var testEmail = re.test(emailValue);
          jQuery("#submitForm").on("click",function(){
              if (jQuery("input[name*='items']").is(":checked"), 
                  testEmail === true){
                  return true;
              } else {
                jQuery('#messages').append("You must choose at least 1 image&lt;br&gt;
                                           Please enter a valid email");
                return false;
              }
  
          });
      });
  </code></pre>