The normal way to do this is to set options.length to 0. I don't know
about elegant, but it is a robust solution.
Walter
On Jun 5, 2008, at 12:05 PM, "Dan Dorman" <[EMAIL PROTECTED]> wrote:
>
> On Thu, Jun 5, 2008 at 9:56 AM, FernandezPablo
> <[EMAIL PROTECTED]> wrote:
>>
>> I know is a dumb question, but I'm trying to clear a dropdownList in
>> an elegant way.
>
> You could try
>
> $('select_id').select('option').invoke('remove');
>
> which simply removes the option elements.
>
> :Dan
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---