Passing dropdown form into variable
I have a dropdown form from which the user selects from a list of query populated options (code blow). This query is in the mycars.cfm page whitch is within my views folder.
<h3>Car Names</h3>
<cfquery name="carbrands" >
SELECT *
FROM carcompany
WHERE cartype_id = 6
</cfquery>
<cfform name="mycars" action="?????.cfm">
<cfselect name="carbrandsearch"
query="carbrands"
value="car_name"
display="car_name">
</cfselect>
I am looking to pass the users selected option (let say Mazda) into a variable so that I can pass that variable into other queries down the page.
I am not sure how to do this. I have tried to tie the submit button to the active page itself but continously get this error - File not found: /views/mycars.cfm. However this is the very page that my dropdown is on so I do not understand why it is giving me this error.
I've also heard mention of the bind function but I am not sure how to use it/if it is appropriate for this case.
I want to be able to pass the car name (Mazda for example) that the user selects into a variable so that I can put that variable into a query where I could idtenify all people who drive the specific car type that the user selected from the dropdown .
What would be the best way to go about doing this?
