Bastian,

DOH! Sometimes I should recall the orginal javascript possibilities.

As I have several select boxes and the first option is always the default
option I
used the following solution:

$$('fieldset#ep4hd select').each(function(s){s.selectedIndex = 0;})

Anyway thanks again.

Alex

2007/11/16, Bastian Feder <[EMAIL PROTECTED]>:
>
>
> Hi,
> actually you just need to find out which is the default value of your
> select box and then select this via script.
> I use the following code for it:
>
> <--snip-->
>
> for (var i=0;i<sel.options.length;i++) {
> sel.options[i].selected = sel.options[i].defaultSelected;
> }
>
> <--snip-->
>
> Add this to you "resetMySelectBox(sel)"- function and you'll be happy ;o)
>
> hf
> Bastian
>
>
> On Nov 16, 2007 7:16 PM,  <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > is there a way to reset a select box to it's default value?
> >
> > Or do I habe to use update() on the select box to empty it and then add
> all
> > the options again?
> >
> > TIA,
> > Alex
> >
> >  >
> >
>
>
>
> --
> --
> spread the word ... see  www.browsehappy.com ;o)
>
> Calvin: Weekends don't count unless you spend them doing something
> completely pointless.
>
> Join the Greater IBM  Connection (
> http://www.xing.com/premiumgroup-6291.d26b7d)
>
> >
>

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

Reply via email to