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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display table containing list box choice

Status
Not open for further replies.

Overmyhead2

Programmer
Jun 5, 2000
39
US
I have 2 related list boxes that work. The second box show a list of dates for the user to choose. How do now display a table containing the date chosen and it's related fields? Here is my code:
<CFFORM ACTION="#CGI.SCRIPT_NAME#" METHOD="Post">
<CFIF IsDefined('form.Select_Category')>
<cfset page.Select_Category=form.Select_Category>
</cfif>
<cfoutput>
<form name="DropDown" method="post">
<cfquery datasource="DSN" username="username" password="password" name="get_Category">
SELECT *
FROM categories
</cfquery>

<!--- Display in a drop-down list --->

<SELECT NAME="Select_Category" REQUIRED="YES" ONCHANGE="this.form.submit()">
<option>Select Category </option>
<cfloop query="get_Category">
<option value='#category#'<cfif isDefined('form.Select_Category')><cfif form.select_category
eq #category#>selected</cfif></cfif>>#category#</option>
</cfloop>
</SELECT>
<cfif isDefined('page.Select_Category')>
<cfquery name="get_OrderDate" datasource="DSN" username="username" password="password">
Select * From #page.select_category#
Where SiteID=#SESSION.Auth.SiteID#
</cfquery>
<select name="select_OrderDate" required="yes" >
<option>Select OrderDate</option>
<cfloop query="get_OrderDate">
<option value="#OrderDate#"><cfif isDefined('page.Select_Category')>
<cfif page.select_category eq #OrderDate#>selected</cfif></cfif>>#OrderDate#</option>
</cfloop>
</select>
</cfif>
</cfoutput>

Really appreciate any help..
Victoria

Victoria
 
I'm not sure I understand what "related fields" you mean, but here is a table with both of the select fields output

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><cfoutput>#form.Select_Category#</cfoutput></td>
<td><cfoutput>#form.Select_select_OrderDate#</cfoutput></td>
</tr>
</table>

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Related fields mean ..I want to display the record *(item1, item2, item3 etc...)from this query:
<cfquery name="get_OrderDate" datasource="Orders" >
Select *
From #page.select_category#
Where SiteID=#SESSION.Auth.SiteID#
that corresponds the the selected #OrderDate# and #Session.Auth.SiteID#..

When I tried this .. get this error msg.
ELEMENT SELECT_CATEGORY is undefined in form

Victoria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top