I have two drop-down menus (A and B) that I would like to populate from one query. I have already managed to populate the drop-downs based on two separate queries but I'd rather use one and use a loop (I think) and/or an if statement to remove records that don't belong in each drop-down.
To clarify:
I have two customer revenue territories with IDs of 26 (A) & 38 (B). I would like one drop-down (A) to only have the customers assigned to revenue ID 26 and the other drop-down (B) to only show customers in revenue territory 38.
My basic query looks like this for drop-down A:
And the drop-down population code looks like this for A:
I then do the same thing for B but with another query that has a WHERE statement of RevenueID=38. Is there any way to have just one query and then loop through each drop-down and remove the IDs I don't want to see?
Sorry if this is unclear. Any help is greatly appreciated!
To clarify:
I have two customer revenue territories with IDs of 26 (A) & 38 (B). I would like one drop-down (A) to only have the customers assigned to revenue ID 26 and the other drop-down (B) to only show customers in revenue territory 38.
My basic query looks like this for drop-down A:
Code:
<cfquery name="dropCustListMid" datasource="example">
SELECT Organization, EndUserID
FROM EndUser_table
WHERE RevenueID=26
Code:
<cfform name="custListForm" action="action.cfm" method="post">
<select name="custListMid">
<cfoutput query="dropCustListMid">
<option value="#EndUserID#">#Organization#(#EndUserID#)</option>
</cfoutput>
</select>
<input type="Submit" value="Go">
I then do the same thing for B but with another query that has a WHERE statement of RevenueID=38. Is there any way to have just one query and then loop through each drop-down and remove the IDs I don't want to see?
Sorry if this is unclear. Any help is greatly appreciated!