I have an ASP.Net MVC Project and I am using unobtrusive jQuery Validation. to add validation when an element loses focus, I am calling
$(document).ready(function
Looks like your projects use different types of validadion (One of them use unobtrusive and second use default).
Please check if you are using next settings in web.config's of both projects.:
Also you are trying to work with first form in your document.
In case when there is no forms - you will get error.
In case when there are more then one form - only first form will use focusout for validation.
So you should do same thing for each form:
$(document).ready(function () {
var $forms = $('form');
$.each($forms, function (key, value) {
// enable validation when an input loses focus.
var settings = $.data(value, 'validator').settings;
settings.onfocusout = function (element) { $(element).valid(); };
});
});