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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.