> I need an input form driven from a loop - up to 52 inputs. One
> set of inputs
> is a database driven select box, which needs to call a query to
> populate the
> drop-down.  I'm having trouble with Nesting the <CFOUTPUT>s.  Here's the
> snippet of code that I'm trying to do:
>
>       <cfloop index="i" from="1" to="52" step="1">
>       <cfquery name="getdupes" datasource="personnel">
>        SELECT *
>        FROM planning_track
>        WHERE week=#createodbcdate(startweek + ((7*(i-1))+ 1))# AND
> person=#person#
>       </cfquery>
>       <cfif getdupes.recordcount is 0>
>       <TR>
>        <td height="40">
>        <cfoutput >
>         Week of #dateformat(startweek + ((7*(i-1))+ 1))#:
>        <input type="hidden" name="week#i#" value=#dateformat(startweek +
> ((7*(i-1))+ 1))#>
>        </td>
>         <TD><select name="task#i#">
>          <option value="">
>          <cfoutput>
>          <option value="#gettasks.task#">#gettasks.task#
>          </cfoutput>
>          </select>
>        </td>
>        <TD><input type="text" name="task#i#"></td>
>       </tr>
>       </cfoutput>
>       </cfif>
>       </cfloop>
>       <tr>
>        <td colspan="2" align="right"><input type="submit"
> value="submit"></td>
>
> I'm getting this error:
>
> Invalid tag nesting configuration
>
> A query driven CFOUTPUT tag is nested inside a CFOUTPUT tag that
> also has a
> QUERY= attribute. This is not allowed. Nesting these tags implies that you
> want to use grouped processing. However, only the top-level tag
> can specify
> the query that drives the processing.
>
> I don't see any way around nesting these tags the way I have... I need to
> use both the loop and the query for the dropdown.
>
> What am I doing wrong?

2 points;

1) both of the CFOutput tags are just that - the are not running over a
query, thus they only display once - what are they meant to do?
2) if you want to put several repeating loops inside each other, use
CFLoops, and CFOutput within them.

<CFLoop query="myData">
        <CFOutput>
        blah
        blah
        blah
        </CFOutput>
        <CFLoop query="myOtherData">
                <CFOutput>
                blah
                blah
                blah
                </CFOutput>
        </CFLoop>
        <CFOutput>
        blah
        blah
        blah
        </CFOutput>
</CFLoop>

is perfectly acceptable. Also, it means that if you want to have loads of
logic, you can turn <CFSetting EnableCFOutputOnly="Yes"> and trim the
whitespace out of the output.

The only way you CAN nest CFOutput tags is by doing the following;
<CFOutput query="myData" group="myColumn">
        New value code
        <CFOutput>
                Repeat while myColumn is the same
        </CFOutput>
</CFOutput>
but this is useless if you want to have values repeated multiple times for a
completely separate query.

HTH (if a bit wordy <g>)

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


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