title: Form validation empty field when checkbox is checked
body: <p>I'm trying to add validation before form submit. There's an alternative input field, let's call this "Optional" and there's checkboxes "Checkbox1", "Checkbox2", "Checkbox3". When user choose one from this checkboxes, then he must fill input "Optional", if it is empty then he can't submit form and get's some pop-up alert with info to fill this.</p>
  
  <p>I have something like this:</p>
  
  <pre><code>&lt;script&gt;
  function validateForm() {
      var x = document.forms["form"]["nrumowy"].value;
      if (x == null || x == "") {
          alert("Numer umowy musi zostać uzupełniony.");
          return false;
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But this input field "nrumowy" must be filled in all situations, so everything okay, and now I want add something similiar but only when one of "Checkbox1", "Checkbox2", "Checkbox3" are checked.</p>