Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding option to dynamic dropdown

Status
Not open for further replies.

rkoya

IS-IT--Management
Jul 12, 2004
57
GB
I have a dynamic dropdown where a list of airports is populate using replacement tags, what I want to do is add a value to say "airport not in list" how can this be done. Here is the code for the dynamic populating:

function checkCollectionMethod() {
if ("(COLLECTION_METHOD)" == "WALKIN") {frmDetails.fldCollectionMethod[1].checked=true;}

cDepAirTxt = new Array ((DEPARTURE_AIRPORT_NAMES));
cDepAirVal = new Array ((DEPARTURE_AIRPORT_VALUES));

for (var i = 0; i < cDepAirTxt.length; i++) {
frmDetails.fldDepartureAirport[frmDetails.fldDepartureAirport.length] = new Option (cDepAirTxt, cDepAirVal);
if (cDepAirVal == "(DEPARTURE_AIRPORT)") {frmDetails.fldDepartureAirport[i + 1].selected = true;} // Use i + 1 because option 0 is "(Please select...)"
}

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top