Solarpitch Posted February 3, 2007 Share Posted February 3, 2007 Hey guys, I have the following script on my page which I am testing out that I got from a tutorial site: Javascript: <script language = "JavaScript"> var Chevrolet = new Array("Camaro","Corvette","Cavalier","Impala","Malibu","Monte Carlo","Prizm"); var Ford = new Array("Crown Victoria","Escort","Focus","Mustang","Taurus","Thunderbird",""); var Oldsmobile = new Array("Alero","Aurora","Intrigue","","","",""); var Pontiac = new Array("Bonneville","Firebird","Grand Am","Grand Prix","Sunfire","",""); function oselect(Title) { var mselect = window.document.form1.Model; var boxx = eval(Title); setopt(window.document.form1.Model, boxx); } function setopt(ychoice, boxx) { for (loop=0; loop < ychoice.options.length; loop++) { ychoice.options[loop].text = boxx[loop]; } } </script> HTML: <form name="form1"> <select name="Make" onChange="oselect(window.document.form1.Make.options[selectedIndex].text);"> <option selected>Chevrolet <option>Ford <option>Oldsmobile <option>Pontiac </select> <select name="Model" multiple size="7"> <option>Camaro <option>Cavalier <option>Corvette <option>Impala <option>Malibu <option>Monte Carlo <option>Prizm </select> </form> Bascially its just a simple list box depentant script that works on http://www.houseofscripts.com/scripts/javascripts/dynamsbox.htm However when I pop it into my and select an option int the list (Make) Firebug gives me the following message: window.document.form1.Make has no properties onchange(change ) Just wondering what sthe reason for this? Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted February 3, 2007 Author Share Posted February 3, 2007 SOLVED Quote Link to comment Share on other sites More sharing options...
irken Posted February 4, 2007 Share Posted February 4, 2007 SOLVED Please provide a solution for future reference . Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted February 4, 2007 Author Share Posted February 4, 2007 Soloution? . . . I was calling form1 twice on the page . . not much of a soloution, but if it makes you happy . . its all good! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.