View Full Version : Drop-Down Menu Contest

12-30-2010, 04:01 AM
What I'm looking for is a series of related drop menus that change the strings involved based on customer’s choice and change the prices.
so it would need some sort of math functions..

so for example:
customer sees one drop down menu titled: manufacturers
once they choose something, the drop menu under it automatically populates new data

• Motorola
• Blackberry
• Nokia
• Sony
• LG
Network Providers:
• Rogers
• Fido
• AT&T
• Tmobile
• Telus
• Verizon
there would need to be if statements to cross reference, so
if(choice1==HTC && choice2==Rogers)
else if (choice1== etc etc etc....)

Does anyone have any idea how to do this? I'm looking to have it in Java.

Regarding the contest, Help me decide what the prize will be. Smile

Thank you,


12-30-2010, 06:49 PM
Would need a bit more information than you have provided thus far.

1. Will all Manufacturers have access to ALL Network Providers or just SOME? If some, which?
2. What prices, or formula applied to a base price, will be applied to each combination?

I don't think your idea of numerous if statements is the best choice, but it could be done.

12-30-2010, 07:45 PM
Major assumption coming ...

You need costs associated with DIFFERENT manufacturers and providers.

Change value to associate different providers with different manufacturers
and enter costs associated with the selections chosen as in example below.


<title>Product Price Data Collection</title>
<script type="text/javascript">
// From: http://www.codingforums.com/showthread.php?t=213522

function AddItems(Items,IDS) {
var sel = document.getElementById(IDS);
for (var i=0; i<Items.length; i++) {
// sel.options[sel.options.length]=new Option(Items[i],Items[i],true,true);
tmp = Items[i].split(':');
sel.options[sel.options.length]=new Option(tmp[0],tmp[1],true,true);
function Populate(IDS,Items) {
var sel = document.getElementById(IDS);
sel.options.length = 0; if (Items == '') { return; }
var ItemArray = Items.split(',');
sel.selectedIndex = 0;

function showCost(info) { alert('Cost: $'+info); }


<form name="convert">

<select name="SBox1" id="SBox1" onChange="Populate('SBox2',this.value)">
<option value="">Choose Manufacturer</option>
<option value="Rogers:10,Fido:20,AT&T:30,Tmobile:40,Telus:50,Verizon:60">HTC</option>
<option value="Fido:10,AT&T:15,Tmobile:20,Telus:25,Verizon:30">Motorola</option>
<option value="AT&T:10,Tmobile:12,Telus:14,Verizon:16">Blackberry</option>
<option value="Tmobile:10,Telus:20,Verizon:30">Nokia</option>
<option value="Telus:10,Verizon:23">Sony</option>
<option value="Rogers:60,Fido:50,AT&T:40,Tmobile:30,Telus:20,Verizon:10">LG</option>

<select name="SBox2" id="SBox2" onchange="showCost(this.value)"></select>


Old Pedant
12-30-2010, 07:51 PM
Does anyone have any idea how to do this? I'm looking to have it in Java.

Then you are posting in the wrong forum.

This is the JavaScript forum.

About the only thing Java and JavaScript have in common are the first 4 letters of their names.