I''m not sure about best practice, but here''s some code.
HTML:
<input onclick=''flipLabel(2)'' type=checkbox
name=''something''
value=''2''> Title <div id=''label_2''
style=''display:none;float:left;margin=left:5px;''>WORD</div>
JAVASCRIPT:
function flipLabel(num) {
Element.toggle(''label_''+num)
}
On Feb 11, 11:25 am, Tarscher
<tarsc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi all,
>
> I have a list with users and for every user a check box (attending or
> not). When the check box is checked I want to show/hide a span next to
> the check box.
>
> The check box behaviour I want:
> - When I load the page I want to show the span if the check box is
> checked. otherwise hide it.
> - When a user checks/unchecks the checkbox, I want to show/hide the
> span
>
> I render the username, checkbox and span via a partial.
>
> Can someone suggest me a best practise?
>
> Thanks
> Stijn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---