You're getting all jokes because your where clause, "WHERE
JokeTitle=JokeTitle", is always true. You need to compare a database
field to a CF variable representing the user's choices. The Select
passes JokeID's to the action template (not JokeTitles), so you'd need
WHERE JokeID in (#JokeID#)
-David
On Tue, 25 Apr 2000 02:17:42 -0400 "Hubert Earl" <[EMAIL PROTECTED]>
writes:
> Hi,
>
> I'm having a problem controlling the output of a form. I have a
> form which
> allows the user to choose up to 5 joke titles from a joke database,
> and a
> form action template which should result in the output of just those
> 5
> jokes, the titles of which were chosen on the form. However, the
> entire
> database gets output. I've pasted the code of the form and action
> template
> below. Please advise me.
>
> The form code:
>
> <CFQUERY
> DATASOURCE="Jokes"
> NAME="Titles">
>
> SELECT JokeID, JokeTitle
> FROM WordJokes
> ORDER BY JokeTitle
> </CFQUERY>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <html>
> <head>
> <title>Jokes</title>
> </head>
>
> <body>
>
> <h1>JOKES</h1>
>
> <FORM ACTION="jokesaction.cfm" METHOD="POST">
>
> Please select joke titles from the contents of the select boxes
> below. You
> may select up to five titles at a time.<P>
>
> Joke title #1:
> <SELECT NAME="a">
> <OPTION>
> <CFOUTPUT QUERY="Titles">
> <OPTION VALUE="#JokeID#">#JokeTitle#
> </cfoutput>
> </select><P>
>
> Joke title #2:
> <SELECT NAME="a">
> <OPTION>
> <CFOUTPUT QUERY="Titles">
> <OPTION VALUE="#JokeID#">#JokeTitle#
> </cfoutput>
> </select><P>
>
> Joke title #3:
> <SELECT NAME="a">
> <OPTION>
> <CFOUTPUT QUERY="Titles">
> <OPTION VALUE="#JokeID#">#JokeTitle#
> </cfoutput>
> </select><P>
>
> Joke title #4:
> <SELECT NAME="a">
> <OPTION>
> <CFOUTPUT QUERY="Titles">
> <OPTION VALUE="#JokeID#">#JokeTitle#
> </cfoutput>
> </select><P>
>
> Joke title #5:
> <SELECT NAME="a">
> <OPTION>
> <CFOUTPUT QUERY="Titles">
> <OPTION VALUE="#JokeID#">#JokeTitle#
> </cfoutput>
> </select><P>
>
> <INPUT TYPE="submit" VALUE="Submit choice(s)">
> <INPUT TYPE="reset" VALUE="Clear">
>
> </FORM>
> </body>
> </html>
>
>
-------------------------------------------------------------------------
---
> ------------------------------------------
>
> The form action template:
>
> <CFQUERY
> DATASOURCE="Jokes"
> NAME="JokeData">
> SELECT Joke
> FROM WordJokes
> WHERE JokeTitle=JokeTitle
> </CFQUERY>
>
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <HTML>
> <HEAD>
> <TITLE>JokeAction</TITLE>
> </HEAD>
>
> <BODY>
>
> <CFOUTPUT QUERY="JokeData">#Joke#</CFOUTPUT>
>
> </BODY>
> </HTML>
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk! For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.