vvomble
Programmer
- Dec 5, 2011
- 8
i'm desperately seeking some javascript advice.
I'm currently using wysiwyg webbuilder 8.
I have one of my combo boxes linking to another but i want the first box to affect text on the page the text id is text23 and here is the coding i am using at the moment
this is the only thing i need to complete the site i am working on
I'm currently using wysiwyg webbuilder 8.
I have one of my combo boxes linking to another but i want the first box to affect text on the page the text id is text23 and here is the coding i am using at the moment
Code:
<script type="text/javascript">
function fillSecondCombo()
{
var combo1 = document.getElementById('Combobox3');
var combo2 = document.getElementById('Combobox4');
var selected = combo1.options[combo1.options.selectedIndex].value;
if (selected == 1)
{
combo2.options.length = 1;
combo2.options[0] = new Option("999 Million Forza 3 Credits", "1");
}
else
if (selected == 2)
{
combo2.options.length = 5;
combo2.options[0] = new Option("999 Million Forza 4 Credits", "1");
combo2.options[1] = new Option("750 Million Forza 4 Credits", "2");
combo2.options[2] = new Option("500 Million Forza 4 Credits", "3");
combo2.options[3] = new Option("400 Million Forza 4 Credits", "4");
combo2.options[4] = new Option("300 Million Forza 4 Credits", "5");
combo2.options[5] = new Option("200 Million Forza 4 Credits", "6");
combo2.options[6] = new Option("100 Million Forza 4 Credits", "7");
combo2.options[7] = new Option("75 Million Forza 4 Credits", "8");
}
else
if (selected == 3)
{
combo2.options.length = 4;
combo2.options[0] = new Option("2k Gamerscore Increase", "7");
combo2.options[1] = new Option("5k Gamerscore Increase", "8");
combo2.options[2] = new Option("10k Gamerscore Increase", "9");
combo2.options[3] = new Option("25k Gamerscore Increase", "10");
}
else
if (selected == 4)
{
combo2.options.length = 4;
combo2.options[0] = new Option("1 Purchased", "7");
combo2.options[1] = new Option("2 Purchased", "8");
combo2.options[2] = new Option("3 Purchased", "9");
combo2.options[3] = new Option("4 Purchased", "10");
}
else
if (selected == 5)
{
combo2.options.length = 4;
combo2.options[0] = new Option("1 Purchased", "7");
combo2.options[1] = new Option("2 Purchased", "8");
combo2.options[2] = new Option("3 Purchased", "9");
combo2.options[3] = new Option("4 Purchased", "10");
}
else
if (selected == 6)
{
combo2.options.length = 4;
combo2.options[0] = new Option("1 Purchased", "7");
combo2.options[1] = new Option("2 Purchased", "8");
combo2.options[2] = new Option("3 Purchased", "9");
combo2.options[3] = new Option("4 Purchased", "10");
}
else
{
combo2.options.length = 0;
}
}
</script>
this is the only thing i need to complete the site i am working on