https://github.com/bobsilverberg/ValidateThis/blob/49b3bdd28f525c87ddbade1572e81be9c1ae1f97/ValidateThis/client/jQuery/JS/jquery.validatethis.js
It seems like Line 109 should be trying to locate a condition for the form in which the element appears. Instead, this selector finds the first form on the page.
Sample HTML:
===================================
<html>
<body>
<form>
....
</form>
<form id="edit-user">
<input name="username" />
<input name="currentUsername" type="hidden" />
</form>
</body>
Sample Client Rules:
===================================
{rules:
{
emailAddress:
{
required:
{
DependentInputName: "",
DependentInputValue: "",
DependentInputDesc: ""
}
}
}
}
Debugger output:
===================================
Uncaught TypeError: Cannot read property 'isNotCurrentUsername' of undefined
This is caused by line 109 of jquery.validatethis.js. The following is selecting the first form on the page (which has no ID, hence "... of undefined" in the error).
Current:
var formID = $(element).parents().find("form:first").attr("id");
Suggested Fix:
var formID = $(element).closest('form').attr("id");
Jason Durham