Thanks, Birgit, for the code.  Unfortunately, I was unable to change my form
fields in a way to make your code work.  Please give me an example.  Thanks.

Hubert
----- Original Message -----
From: Birgit Pauli-Haack <[EMAIL PROTECTED]>
To: Hubert Earl <[EMAIL PROTECTED]>
Sent: Tuesday, April 25, 2000 7:20 AM
Subject: Re: Problem controlling output


>
> Hello Hubert,
>
> you might change your query. The old query just gives you all
> jokes, but you only want the 5 jokes, selected in the form
>
> > <CFQUERY
> > DATASOURCE="Jokes"
> NAME="JokeData">>
> > SELECT Joke
> > FROM WordJokes
> > WHERE JokeTitle=JokeTitle
> > </CFQUERY>
>
> You are not using any variable coming from your form... You might
> like to look at somthing similar to the following:
>
> SELECT JokeID, JokeTitle, Joke
> FROM WordJokes
> ORDER BY JokeTitle
> WHERE JokeID in
>         (#form.jokeid1#,
>         #form.jokeid2#,
>         #form.jokeid3#,
>         #form.jokeid4#,
>         #form.jokeid5#)
>
> you would have to change your form fields accordingly to make this work.
>
> There is nothing wrong with your output...:-))
>
> Good luck
>
> Birgit
>
>
> Tuesday, April 25, 2000, 2:17:42 AM, you wrote:
>
> > 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>
>
> > ---
> > Hubert Earl
> > ICQ#:  16199853
>
> > I develop & maintain web sites internationally.  I also build web
> > applications using CGI scripts written in Perl.  I accept subcontracting
> > work.
>
> > **Personal web site:  http://www.geocities.com/SiliconValley/Peaks/8702/
> > (please remember to view this with a sense of humour!)
>
> > **Business web page:  http://home.talkcity.com/MigrationPath/hearl/
>
>
> --------------------------------------------------------------------------
----
> > 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.
>
>
> --------------------------------------------------------------------------
----
> 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.

------------------------------------------------------------------------------
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.

Reply via email to