client-side form validation

hey all,

I am having a hard time looking for a plugin/gem to auto-validate a form in client-side, just like “live-validations”…

I tried to download and install it via “script/plugin install git://github.com/porras/live-validations.git

but no plugin was found…

i don’t wanna know from you guys HOW to do it, i just wanna know if anyone here uses this kind of validation, and which plugin/gem you use…

So, any ideas?

I`ll keep up the research for a way to do it easily…

Oh, important: i need a tool that does the validation according to model rules…

Thanks in advance.

Sempre Alerta Para Servir,

Lucas Franceschi Equipe de Programação (Automação) SGI Sistemas (049) 9922-3360

lucas franceschi wrote:

I am having a hard time looking for a plugin/gem to auto-validate a form in client-side, just like "live-validations"... <snip> i don't wanna know from you guys HOW to do it, i just wanna know if anyone here uses this kind of validation, and which plugin/gem you use...

Personally, I don't generally use client-side validation. The problem that I see with doing validation client-side is that there is no guarantee that client-side scripting is enabled. Which means that any client-side validation must be duplicated server-side anyway.

Any differences in server and client validation algorithms could be confusing to the user, or worse end up allowing invalid data to reach the database. If you were relying on a particular client-side validation that did not exist server-side (either accidentally or by design) that could easily allow invalid input into the database.

I prefer to have all my validation logic side the model (server-side). I am of the opinion that it is the responsibility of the Model layer of MVC to validate data and not the View layer. Although the view objects can often assist the user with entering proper values, such as with drop-downs, checkboxes, radio buttons, etc. But, I would not rely on the view for full and proper input validation.

Personally, I don't generally use client-side validation.

It's painful when you upload a 10MB file with the form, and then server-side validation tells you you forgot to type a description. Now you need to reupload the 10MB file...

http://articles.sitepoint.com/article/form-validation-client-side

well, I do think your point is quite right, that’s why you never use pure javascript validation in the view…

what i am talking about, is a gem, or plugin, that you don’t need to say what to validate, it just, reads the model rules, and apply it in the view…

actually, ‘live-validations’ do it, but i’m having trouble making it work…

that’s why i came to you guys…

anyone?

Sempre Alerta Para Servir,

Lucas Franceschi Equipe de Programação (Automação) SGI Sistemas (049) 9922-3360

Fernando Perez wrote:

Personally, I don't generally use client-side validation.

It's painful when you upload a 10MB file with the form, and then server-side validation tells you you forgot to type a description. Now you need to reupload the 10MB file...

That exactly why I included the word "generally." I was not talking about specific cases such as you describe.

Robert, I agree with you, but if there was a gem, that would just do the validation based on the model rules, wouldn’t it solve your problem, and mine’s? well, there is that gem, that plugin, whatever… and there’s more than one, live-validation and client-side-validation, plugin and gem repectively, exists for this purpose… but it’s not working… i just cant get it to work the way all the how-to’s say…

anyone here did use one of those???

Sempre Alerta Para Servir,

Lucas Franceschi Equipe de Programação (Automação) SGI Sistemas (049) 9922-3360