0

My files are in this order

 <script src="~/Content/js/jquery.min.js"></script>
 <script src="~/Content/js/jquery.validate.unobtrusive.js"></script>
 <script src="~/Content/js/jquery.unobtrusive-ajax.min.js"></script>
 <script src="~/Content/js/jquery.validate.min.js"></script>
 <script src="~/Content/js/jquery.validate.mvc.js"></script>
 <script src="~/Content/js/responsive-table-ul-main.js"></script>
 <script src="~/Content/js/bootstrap.min.js"></script>

i am getting this error on page " Cannot set property 'unobtrusive' of undefined" .when i submit button or load page this error coming in console

1
  • 1
    Put your jquery.validate js scripts just after jquery.min. Commented Dec 9, 2015 at 12:02

1 Answer 1

1

Looking at bower file of jquery validation unobtrusive: https://github.com/aspnet/jquery-validation-unobtrusive/blob/master/bower.json

It is clear, that it depends on jquery.validate scripts. So you need to put them before jquery.validation.unobtrusive in your html, like this:

 <script src="~/Content/js/jquery.min.js"></script>
 <script src="~/Content/js/jquery.validate.min.js"></script>
 <script src="~/Content/js/jquery.validate.mvc.js"></script>
 <script src="~/Content/js/jquery.validate.unobtrusive.js"></script>
 <script src="~/Content/js/jquery.unobtrusive-ajax.min.js"></script>
 <script src="~/Content/js/responsive-table-ul-main.js"></script>
 <script src="~/Content/js/bootstrap.min.js"></script>
Sign up to request clarification or add additional context in comments.

3 Comments

its worked for me but there is an issue when i feel the box and click outside anywhere it doesn't remove the validation border error css
Cannot read property 'call' of undefined this error coming in console
Try commenting out "jquery.validate.mvc.js" file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.