Jump to content

[SOLVED] Firebug script error?


Solarpitch

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.