Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. the selectList can't make selected in Netscape...

the selectList can't make selected in Netscape...

Scheduled Pinned Locked Moved Web Development
javajavascriptphpdata-structureshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cool_man
    wrote on last edited by
    #1

    I want to make a select box in a Javascript function, this is my code: var val = new Array('0','1','2','3','4','5'); var lis = new Array('java','php','asp','jsp','vbscript','jscript'); function makeOption(obj,selectID) { obj.options[0] = new Option(lis[0],val[0],false,false) for(i=1;i<lis.length;i++) if (val[i]==selectID){ obj.options[i] = new Option(lis[i],val[i],false,true); } else{ obj.options[i] = new Option(lis[i],val[i],false,false); } } var selectID = 3 makeOption(document.form1.ProgramList,selectID); The trouble is in Netscape the selectlist can't make selected with selectID("asp"), the selectlist its always select the first item "java". But this code run correct in IE. Is Anybody can help me, please? Thanks for all response!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups