bcardarella/client_side_validations — Issue #293: Uncaught ReferenceError: ClientSideValidations is not defined
Author: MrGando
Created: 2012-03-08 19:22:29+00:00
State: open

I created __rails.validations.callbacks.js__ file in app/assets/javascripts

That file contains:

```javascript
ClientSideValidations.callbacks.element.fail = function(element, message, callback) {
callback();
if (element.data('valid') !== false) {
element.parent().find('.message').hide().effect('highlight', {}, 2000);
element.animate( { backgroundColor: "#ffffcc" }, 1000);
}
}

ClientSideValidations.callbacks.element.pass = function(element, callback) {
// Take note how we're passing the callback to the hide()
// method so it is run after the animation is complete.
element.parent().find('.message').effect('fade', {}, 2000, callback);
element.animate( { backgroundColor: "#ffffff" }, 1000, callback);
}
```

In the javascript console, I get:

Uncaught ReferenceError: ClientSideValidations is not defined

I know that ClientSideValidations is working in my site because it's validating my form fields, but for some reason my callbacks file doesn't see a definition for ClientSideValidations