title: Change the border color if input value is null
body: <p>I wanted to do is change the color of ALL the input text borders at the same time if it/they have null or no value upon clicking the button, I have a function to do this.
  First I put the input text that I want to check the values into an array, then call the function where in it loops through the array and check for the null values. On button click, if all of my input text are null it will only change the color of the first index in the array. </p>
  
  <p>Here is my function:</p>
  
  <pre><code>function isValid(array){
              for(var x=0;x&lt;array.length;x++){
                  if (array[x].value.trim() == ""){
                      $(array[x]).css("border-color","#FF0000");
                      return false;
                  }
              }
          }
  </code></pre>
  
  <p>This is how I call my function: </p>
  
  <pre><code>var array = [document.getElementById('txtLastName'),
              document.getElementById('txtFirstName')
              ];
  if (!isValid1(array)) {
  return false;
      }
  </code></pre>
  
  <p>How to change the border color of all the input in the array with null values?
  Thanks!</p>