Comment to 'Zipcode validation '
  • An alternative, if the list is more extensive: create a JavaScript function for the page that loops through the array and returns true when a matched is found or false if it exits the loop without a match. The function could employ a regex if the data is complex. However, if it's a concrete list, then JavaScript doesn't need to use regex; a simple loop will do.