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 <[EMAIL PROTECTED]> 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 [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-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---