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...
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