Are you trying to toggle a label?
$$('form#formId label')[0].toggle();
$('formId').down('label').toggle();
$$('label[for="firstNameId"]')[0].toggle();
// etc.
Which not-supported attributes are you talking about?
- kangax
On Jun 4, 5:05 pm, kentb <[EMAIL PROTECTED]> wrote:
> Hi all -
> This is a newbie question. Given a simple form such as
>
> <form>
> <label for="firstNameId">First Name</label>
> <input id="firstNameId" name="firstName" type="text" value="">
> </form>
>
> we can use Element.toggle('firstNameId') to toggle visibility of the
> input field, which is great.
>
> Is it really true that this cannot work for the label field as well?
> It looks to me like it's not possible because 'label' only supports 2
> attributes in the DOM, and 'visible' is not one of them?? Can this
> really be??
>
> It just seems really silly not to support other basic attributes. Am
> I missing something? Do I see this clearly? What workarounds are out
> there for this?
>
> Sorry if this is too simple - I searched around but didn't see
> anything addressing this. I did notice in Firebug and in my JS that
> the label fields have no id themselves...seems ridiculous. Maybe
> there's a good reason?
>
> Thanks a lot -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---