I am trying to create one of those standard new password forms, where you type the new password once and then a second time to confirm. I would like it so that once you blur
Try the below code. You are getting that error because jQuery returns an array of selected objects and since setCustomValidity
is supported by native input elements and not jquery objects, you are seeing that error.
$('#newpassword1, #newpassword2').each(function() {
this.setCustomValidity(errorMessage)
});