I'm relatively new to Rails, but am very enamored with it for the most
part so far. I have a contacts page where the User enters his/her
personal information. I'm using the server-side validates_presence_of,
and downloaded a plugin that allows me to validate_date_time. I would
like to do some javascript client-side validation, and wonder what the
ROR approach is to this, as it's bound to be different (probably much
nicer) than what I have done in the past. I thought this would show up
immediately googling, but haven't found exactly what I was hoping for.
Thanks, Rob
--
Posted via http://www.ruby-forum.com/.
On Fri, 2009-07-03 at 17:47 +0200, Rob Cash wrote:
> I have a contacts page where the User enters his/her
> personal information. I'm using the server-side validates_presence_of,
> and downloaded a plugin that allows me to validate_date_time. I would
> like to do some javascript client-side validation, and wonder what the
> ROR approach is to this, as it's bound to be different (probably much
> nicer) than what I have done in the past.
Sorry to disappoint, but Rails is server-side. If you want to do it
client-side you're going to have to write some Javascript.
Best regards,
Bill
But, if you are needing to do client-side validation within a form that
is not backed by a model, you need to use javascript validation. And,
that means you can pretty much use any javascript validation script
that's on the net for your purposes. Rails works hand in hand with
java/ajax...
Thanks to all for the replies! ... Lakshmi, I'll give this a try and may
be back with you for questions.
Lakshmi ... Just wanted to thank you for turning me on to Jquery. All I
can say is WOW ! This is so much cleaner than classic JavaScripting.
Rob