Postgresql Loop Through Array Jquery Validation Example