title: How to write alerts from field in one line?
body: <p>I am checking the input from the text area with regex, and if there is an error it gives an alert</p>
  
  <p>this is my script:  </p>
  
  <pre><code>var lines = dateinput.value.split(/\r?\n/);
  for(var i = 0; i&lt;lines.length ; i++){
      if (lines[i].match(regex) == null) {
          alert('There is an error in the ' + (i + 1) + ' line. Please enter a valid date formatted DD/MM/YYYY');
      }
  }
  </code></pre>
  
  <p>It can be annoying if you have a lot of them</p>
  
  <p>is there a way to write all the wrong lines into one alert?</p>