Results 1 to 6 of 6

Thread: cel.options[1].selected=true; in netscape?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843

    cel.options[1].selected=true; in netscape?

    I am having problems with this instruction in netscape

    cel.options[1].selected=true;


    where cel is a dropdown with many items in it... why!?!
    "The difference between mad and genius is the success"

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843
    how can I select an item from a dropdown with javascript that is valid in netscape...??!?!
    "The difference between mad and genius is the success"

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Which version of NS are you talking about? This works in 6.2:

    Code:
    <form id="form1" action="#">
      <select id="select1">
        <option>Option 1</option>
        <option>Option 2</option>
        <option>Option 3</option>
        <option>Option 4</option>
        <option>Option 5</option>
      </select>
      <input type="button" value="Select"
      onclick="document.forms['form1'].select1.options[3].selected = true;" />
    </form>

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Re: cel.options[1].selected=true; in netscape?

    Originally posted by Andreex
    I am having problems ... in netscape
    Buddy, give us a ring if you ever DON'T have problems.

    But the real reason I posted... I heard its better to use NAME in NS... not sure where I heard it though, probably wrong
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843
    haha... I know Netscape is a pain.... but I will try the code Rick Bull posted to see if it works
    "The difference between mad and genius is the success"

  6. #6
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Version 6+ of NS are usually a lot better than IE for doing things with (for example) CSS that would otherwise take ages doing with JavaScript in IE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width