On 8 March 2010 08:55, Andy Jeffries <[email protected]> wrote:
>> <%= check_box_tag "note[froglet_ids][]", froglet.id %> <%= h
>> froglet.name %><br />
>>
>> These get submitted as an array and all works well, except for the
>> fact that firebug gives me warnings on the page (anchor
>> note_froglet_ids_ is already defined) as all the checkboxes have the
>> same name attribute.
>
> How about using something like:
> <%= check_box_tag "note[froget_ids][]", froglet.id, :id =>
> "note_froglet_id_#{froglet.id}" %>
> The ID is automatically generated from the name, given that they're all
> having the same name it's not surprising they're all having the same ID.

Rather to my surprise this has removed the warnings (it is the html
validator plugin for FF that is showing the warnings of course, not
firebug).  I am surprised as I thought that the name and id both have
to be unique and while this fixes the id the names are still the same.
 In fact the error in the validator specifically referred to the name.
 Having fed the source into the w3c validator however it specifically
complains about the ids not being unique, and treats it as an error
not a warning, so this may be a deficiency in the validator plugin.

Many thanks for the help.

Colin

> Cheers,
>
> Andy
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to