title: Javascript validation for an Adobe Form Field - Email Cc (Multiple email inputs)
body: <p>I'm trying to validate a form field with multiple line inputs in a text field separating them only by a new line.</p>
  <p>Here is my code so far:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var splitInput = event.value.split("\n");
  var pattern = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/; 
  for(i=0;i&lt;splitInput.length;i++) {
      if (event.value!=""){if (!pattern.test(event.value)){event.rc = false;app.alert("\"" + event.value + "\" is not a valid email address.");};};
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Ps: I'm fairly new to coding but I do understand this is a complicated script.</p>