Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

jQuery 1.5 broke my validation

DZone's Guide to

jQuery 1.5 broke my validation

· Web Dev Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.

jQuery 1.5 includes a complete overhaul of the AJAX module. However, it broke the validation jQuery plugin remote calls that ValidateThis uses.

Whilst debugging it in Firebug, I noticed that a new "callback" parameter is passed to the server, which you didn't have with jQuery 1.4.4. After a bit of googling I found a comment on a mailing list that you need to include this callback in your server response.

Previously, the server side script just had to return true or false, so this worked fine:

<cfset result = "true">
<cfoutput>#result#</cfoutput>

With jQuery 1.5, you need to do this:

<cfset result = "true">
<cfoutput>#url.callback#(#result#)</cfoutput>

Hope that saves someone some head scratching!

Update: This is fixed in the jQuery plugin repo on github: 

https://github.com/bigfix/jquery-validation/commit/9aa53f9241224ba349f9fe1b2c801be0f431b63b

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}