Forum: Ruby on Rails Newbie AJAX validation problem. How do I validate field and

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jesper Rønn-Jensen (Guest)
on 2006-02-05 12:18
(Received via mailing list)
I want to validate a field via AJAX in my Rails application. If there
is an error, I want to set an error class on the text field and give
it class="error" to color it appropriately in CSS.

I've been looking at
<%=     observe_field 'fieldname',
       :update => 'another_fieldname',
       :url => {:action => "validate"}
%>

This requires me to put the notification in another field. But what I
really want here is to update the same field, and it's CSS class.

Could you point me to a function that could do this?

THANKS!



--
Jesper Rønn-Jensen
Capgemini Danmark A/S
Oernegaardsvej 16
DK - 2820 Gentofte
Denmark

+45 23 73 62 20 (Mobile)
Blog: http://justaddwater.dk/ - Instant usability and web standards
This topic is locked and can not be replied to.