datepicker.ui + validate plugin -- triggers 'invalid' when date 1st picked

datepicker.ui + validate plugin -- triggers 'invalid' when date 1st picked

I'm using the datepicker.ui in a form that also uses the validate plugin. The form happens to use the accordion functionality found here, but I've also tested this in a simpler form that uses the standard syntax for both scripts.

When the user initially picks a date using the datepicker, validate runs and flags the input as invalid, even 'though the field is valid. choosing another date, or choosing the date a second time, sets the field to valid. Simplified HTML:
  1. <label for="datepicker">Date</label>
  2.             <input name="datepicker" class="datepicker pageRequired date" type="text" value="Click Me!" />
and JavaScript excerpt, minus some accordion stuff:
  1. $.validator.addMethod("pageRequired", function(value, element) {
  2. var $element = $(element)
  3. function match(index) {
  4. return current == index && $(element).parents("#sf" + (index + 1)).length;
  5. }
  6. if (match(0) || match(1) || match(2) || match(3) || match(4)) {
  7. return !this.optional(element);
  8. }
  9. return "dependency-mismatch";
  10. }, $.validator.messages.required)

  11. var v = $("#order-form").validate({
  12. submitHandler: function() {
  13. alert("Submitted, thanks!");
  14. }
  15. });
I'm still pretty new to JS & jQuery, so any answers may need to be spelled out pretty explicitly.

Thanks for your interest,

--cz