Forum: Ruby on Rails Realtime form validation for forms containing collections

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.
Martin G. (Guest)
on 2006-06-12 19:46
(Received via mailing list)
Hi,

I'm successfully using the realtime_form_validation plugin from
http://railsrtv.rubyforge.org/ However, my forms contain collections,
as described in the AWDWR book. Basically my form looks like this.

                     2004   2005   2006
Question 1         12       13      15
Question 2          9        11      13

I have the following code to generate ids for my input fields. In my
view and my controller I have realtime_validation setup properly (all
other forms without collections work fine!)

<% @id = 1 %>
<% for @model_name in @model_instance_var %>
  <td class="questin"><%=text_field("model_name[]", 'field_name', :id
=> "modelname[" + @id.to_s + "]_field_name") %>
  <% @id += 1 %>
<% end %>

However, this is not working! Any tips on how to get forms containing
collections working with realtime validation? I would really
appreciate any help!

cheers
Martin
This topic is locked and can not be replied to.