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? Link to comment https://forums.phpfreaks.com/topic/36915-solved-firebug-script-error/ Share on other sites More sharing options...
Solarpitch Posted February 3, 2007 Author Share Posted February 3, 2007 SOLVED Link to comment https://forums.phpfreaks.com/topic/36915-solved-firebug-script-error/#findComment-176116 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 . Link to comment https://forums.phpfreaks.com/topic/36915-solved-firebug-script-error/#findComment-176794 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! Link to comment https://forums.phpfreaks.com/topic/36915-solved-firebug-script-error/#findComment-176810 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.