Validate: Making multiple elements with the same name all required

Validate: Making multiple elements with the same name all required

I have a form with multiple elements with the same name (this gets treated as an array of values on post). I want them all to be required, but when I submit the form it passes validation if only one of them has a value.

E.g:

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3.     $("form").validate({
  4.         rules: {
  5.             field: "required"
  6.         }
  7.     });
  8. });
  9. </script>
  1. <form>
  2. <select name="field">
  3.     <option value="">Select...</option>
  4.     <option value="something">Something</option>
  5. </select>
  6. <select name="field>
  7.     <option value="">Select...</option>
  8.     <option value="something">Something</option>
  9. </select>
  10. <button type="submit">Submit</button>
  11. </form>
 Thanks,

Chris