Alternative to Event Handle in jquery.validator

Even with the validation built into html5 there always seems to be the need for something very unique.  For example, if you need to make sure that First Name and Last Name are filled, or you need to make sure a particular user does not exist before continuing then you will come to realize that the jquery validator is a very good compliment if not still the choice of validation requirements.  I have always loved this validator and still make it an almost automatic load on every web form that requires user input.  I was surprised to see that I had a problem using the validator with jquery 1.9.  After searching the internet for the error message I was receiving:

The function “call” cannot be called because .handle is undefined.

Apparently several people have determined that the solution is to add the Jquery migrate plugin.  Although not the most optimal solution, this seems to work; however, I have many other javascripts that I use and adding another one seems unpractical.  Therefore; until the validator is “corrected”, if it is even a bug (with the new Jquery).  Here is the step by step solution.

1.  Open jquery.validate.js in notepad or some other tool that will give you line numbers.

2. Locate the following line in the code. (Around Line 1152)

return $.event.handle.call(this, e);

3. Comment it out using //

4. Add the following line right below.

return $.event.dispatch.call( this, e );

5. Save the file

That’s it.  If you want to minify the js then you can run it through a tool like this.

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , | Posted under Internet, Programming/Coding | RSS 2.0

Author Spotlight

David Bauernschmidt

David Bauernschmidt

I live in the historical triangle of Virginia where I am married with two daughters. I have spent over 13 years working for a Fortune 500 company in the computer area. I started in VB 6.0 and by the time I ended my employment I was supervising a development team where we built many web applications. When my first daughter was born I wanted to spend more time with her so I left and became a programmer analyst for local government as well as launch my own company. Since then I have grown James River Webs into a profitable web design and application company helping small businesses create a big presence on the internet. As an employee I have created web application used by citizens and other companies. I enjoy fly fishing, and spending time with my family. I also enjoy learning new approaches and development tools when it comes to developing applications.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 4 = 13

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>