...

View Full Version : Help with drop downs



bkbandit
07-08-2007, 03:43 AM
I have a form site that needs to do the following

Drop Down 1: Choose a Property Type
Drop Down 2: Choose a Value (based on DD1 Selection)
Drop Down 3: Choose a Payment Type (based on DD2 Selection)
Drop Down 4 or Text Box: With the Price (based on DD3 Selection)


I have the first three Drop downs doing what I want, I cannot get the forth drop down to give me anything,

The code is very long so I posted it to a website where you can see the code and the way it is supposed to act..

PLEASE help

http://www.laurelriverdesigns.com/Programming/ba.html

rwedge
07-08-2007, 10:07 PM
Giving it a quick look:
One thing that makes it so long is you have the same function "selectChange()" repeated three times. It is only needed once.

This is totally untested:
for ( x = 0; x < ItemArray.length; x++ ) {
if ( GroupArray[x] == control.value ) {
if (controlToPopulate.name == 'A') {
controlToPopulate.value = x;
} else {
myEle = document.createElement("option") ;
myEle.setAttribute("value",x);
var txt = document.createTextNode(ItemArray[x]);
myEle.appendChild(txt);
controlToPopulate.appendChild(myEle);
}
}
}


<input type="text" id="fourthChoice" name="A" size="32" style="font-weight: 700">

bkbandit
07-09-2007, 05:22 AM
Thanks for the help, I have it working know



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum