Selected attribute for select control doesn't work in Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eric.goforth@gmail.com

    Selected attribute for select control doesn't work in Firefox

    Hello,

    I have the following select control:

    <SELECT name="Currency" >
    <OPTION VALUE="1">$-USD-US Dollar</OPTION>
    <OPTION VALUE="2" SELECTED >£-GBP-British Pound</OPTION>
    <OPTION VALUE="3">€-EUR-Euro</OPTION>
    <OPTION VALUE="4">$-CAD-Canadian Dollar</OPTION>
    <OPTION VALUE="5">$-AUD-Australian Dollar</OPTION>
    <OPTION VALUE="6">$-NZD-New Zealand Dollar</OPTION>
    <OPTION VALUE="7">$-MXN-Mexican Pesos</OPTION>
    <OPTION VALUE="8">R$-BRL-Brazilian Real</OPTION>
    <OPTION VALUE="9">$-ARS-Argentinean Pesos</OPTION>
    <OPTION VALUE="10">Bs-VEB-Venezuelan Bolivar</OPTION>
    <OPTION VALUE="11">kr-SEK-Swedish Krona</OPTION>
    <OPTION VALUE="12">Â¥-JPY-Japanese Yen</OPTION>
    <OPTION VALUE="13">Rs-INR-Indian Rupee</OPTION>
    <OPTION VALUE="14">å…ƒ-CNY-Chinese Yuan</OPTION>
    <OPTION VALUE="15">$-HKD-Hong Kong Dollar</OPTION>
    <OPTION VALUE="16">$-SGD-Singapore Dollar</OPTION>
    </SELECT>

    When I view it in IE6 British pounds show as being selected. When I
    view the page in Firefox 1.5.0.6 US Dollars show as selected. Any idea
    why? I originally had it rendered as
    <OPTION SELECTED VALUE=2 SELECTED >£-GBP-British Pound</OPTION>

    So I've played around with putting the SELECTED before the VALUE and
    with it in it's current position. I've also played around with putting
    double and single quotes around the values.

    Thanks,
    Eric

  • David Dorward

    #2
    Re: Selected attribute for select control doesn't work in Firefox

    eric.goforth@gm ail.com wrote:
    When I view it in IE6 British pounds show as being selected. When I
    view the page in Firefox 1.5.0.6 US Dollars show as selected. Any idea
    why?
    Likely you are running into Firefox keeping the selected value when the page
    is refreshed. Leave the page and then return to it. You'll probably see it
    start to work.

    --
    David Dorward <http://blog.dorward.me .uk/ <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    Working...