I need to validate form on client-side and I was wondering if there is a rails plugin which will help me in this task? Maybe it will build javascript needed to validate certain model from ActiveRecord validations?
No you have to write your own javascript to validate the form.
You can apply some validation such as "field can't be blank" or "minimum characters required should be 6" or "value should be valid integer" on client side but how do you validate "Username should be unique" etc on client side?
Also You should validate your model on Serverside although you are applying Client Side Validations because User may Submit the Form by disabling javascript of Browser.
Hi tig,
validation from client side you have 2 options
1 - using pure javascripts (but you will not be able to validate somethings like 'uniqueness' which requires database support)
2 - Using Ajax do your validations from the back end You may use something like Ajax.Updater to show green color tick or red cross upon validations
And If you want to use ActiveRecord validations I would recommend 'livevalidation' plugin http://github.com/porras/livevalidation.git
hope this helps
cheers sameera