The short question is: I have a webpage in coldfusion / asp.net with many drop down lists. I want to be able to do an if statement to see if a list has an item selected, and if so grab the value of that item.
Long version:
I have a page that has multiple drop down lists to drill down to a specific location in the country. When you open the page only one or two lists are selectable, the rest are hidden. After an option is selected, the form is submitted and once the form is submitted, the new page loads the old data into the previous lists and unhides a new list, etc etc until all options have been checked. It is storing these variables by way of the url, I am editing it to split up one of the lists into two lists. I cannot add anymore variables to the url.
The way I wanted to do this, was add a drop down list that was hidden until the list above it was chosen, and then using that choice run a sql query to get the data to populate the new list. However, I could not find an easy way to retreive the text in the previous list.
Here is the code for the initial drop down, that once selected I want to populate a new list from.
<select name="siteid" onChange="submitThis('site');">
<option value="">- SELECT ONE -</option>
<cfoutput query="getSites">
<option
value="#getSites.siteid#"
<cfif attributes.siteid eq getSites.siteid>SELECTED</cfif>
>#getSites.siteDetail#</option>
</cfoutput>
</select>
Try this tutorial:
http://www.forta.com/blog/index.cfm/2007/5/31/ColdFusion-Ajax-Tutorial-2-Related-Selects