On Thu, Jul 9, 2009 at 9:57 AM, Frederick
Cheung<[email protected]> wrote:
> On Jul 9, 2:56 pm, jhaagmans <[email protected]> wrote:
>> Hi,
>>
>> I have a check_box and on activating it, I want an extra field to show
>> up.
>>
>> I thought I'd do this by calling a remote_function called "toggle"
>> in :onchange. In toggle.rjs, I'd do something like page.toggle and
>> have the visibility toggled. I'm not sure whether it works: I haven't
>> tried it yet. What I did try was setting up a form with a hidden field
>> (by default the check_box isn't ticked, so the field should be
>> hidden), but the field label is still there. Is there a way to do this
>> so I can toggle both the field and the label?
>>
>> Any other suggestions to do this (without page.toggle maybe?) are very
>> welcome as well.
>>
> Call page.toggle twice - once on the label, once on the field ?

Or put both the label and the field in an enclosing element (e.g. a
span or a div) and toggle visibility on that.

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~---------~--~----~------------~-------~--~----~
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