Search code examples
ruby-on-railsruby-on-rails-5client-side-validation

Rails client side validations customize a pass message


I have implemented Rails gem client_side_validations which works great. Though I would like to add a pass message after each field value passes validation and I can't figure out if this is native to the gem.

Actuallly what I would like to do is add a "tick" symbol.

Is it possible to customize it this way easily ?


Solution

  • Try using a callback to achieve this: ClientSideValidations.callbacks.element.pass(element, callback, eventData)

    From the Callbacks section in the documentation:

    All form callbacks will receive the form in a jQuery object as the first 
    parameter and the eventData object as the second parameter.