markbanker
Programmer
I need to use the value of a user's selection within the WHERE clause of my SQL statement on the page that the form was submitted to. I keep getting errors, saying that it doesn't recognize my variable. What am I doing wrong? It should be so simple. The form is dynamically populated using the get_prodCat Query. Here's the code snippets from the two pages:
Thanks for your help!
Mark Banker
Code:
<FORM METHOD="post" ACTION="search_display.cfm">
<SELECT>
<OPTION VALUE=0>-Category-
<CFOUTPUT QUERY="get_prodCat">
<OPTION NAME="ca_id" VALUE="#ca_id#"> #ca_desc#
</CFOUTPUT>
</SELECT>
<INPUT TYPE="submit" VALUE="Search">
</FORM>
file: search_display.cfm
<CFQUERY NAME="get_prodCat" DATASOURCE="EMSCO" DBTYPE="ODBC">
SELECT ca_id,
ca_desc
FROM category
WHERE ca_id = #ca_id#
</CFQUERY>
Mark Banker