Sunday 6 November 2016

javascript error SOLVED: Uncaught TypeError: $(...).validate is not a function(…)

It's a very interesting thing. If you are writing your own js function for validation, you can stuck with this Uncaught TypeError. If you are using Google Chrome, you can find the error from console. And it would look like the following screen shot.

Reason: This error comes when there is not defined the function '.validate()'.

Solve: To solve this error you have to attach the file where .validate() is defined. You can put the following CDN link before loading your custom js file or your validation script.

src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>


OR
You can download the file jquery.validate.js and upload it to your js directory then put the link before loading your custom js file or your validation script.

Please comment if it was helpful. Thanks for visiting. 

2 comments: