Adding the SharePoint PeoplePicker to jQueryValidator using rules method

Adding the SharePoint PeoplePicker to jQueryValidator using rules method

Hello,

I have a SharePoint custom list form where I use the jqueryvalidation.org library to provide form validation.

When the form is running the document.ready() event/method I assign relevant fields for validation using for example:

var _validator = $('form').validate({

     debug: true

});

var assignedTo = $().SPServices.SPFindPeoplePicker({

     peoplePickerDisplayName: 'Assigned To'

});

$(assignedTo.contents).rules("add", {

     required: true,

     messages: {

          required: "Title is a required field."

     }

});

During the PreSaveAction() form event I call the _validator.form() method.

I've got this working for date picker, radio button groups, etc but have not got it working the peoplepicker control. I've even tried to create a custom method "knownUser" but this doesn't change the result which is that the rules method raises an error "Unable to get property 'nodeName' of undefined or null reference."

The selector assignedTo and assignedTo.contents contains valid element so I'm not passing an undefined value to the rules method.

Reviewing this forum and searching the internet has surprisingly not provided an answer as most people seem to implement their own validation.

Surely someone has resolved this and I'd really appreciate a solution.

Thanks,