Hi everyone i've come accross a problem
I'm creating dynamic select boxes. i can have none to infinity and so i need
for them to have dynamic names. Because i'm not allowed to have select boxes
with the same name.
but when i post my results i'm having a problem resolving the the name of
the select box.
i thought i had fixed it by sending the recordcount number and looping
through the name. but by doing this it only gives me the name of the select
box not the value.
Does any one know the answer please.
Thank you,
Metzy
Here is some code below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Listing Fact</title>
</head>
<body>
<cfif call is "save">
<cfquery name="factOutput" datasource="#dsn.listings_v2#" dbtype="ODBC">
SELECT
distinct factType
FROM
fact
WHERE
Type_id = #Type_id#
</cfquery>
<cfquery name="listingFact" datasource="#dsn.listings_v2#" dbtype="ODBC">
DELETE
FROM
listingFact
WHERE
listing_id = #txtListing_id#
</cfquery>
<!--- #factRecord#
<CFOUTPUT>
/cfoutput> <#CUISINE#--->
<cfoutput query="factoutput">
<CFLOOP INDEX="thislistingFact" LIST=#factOutput.facttype#>
#txtListing_id#<BR>
#thislistingFact#<BR><BR>
<CFSTOREDPROC DATASOURCE="#dsn.listings_v2#"
PROCEDURE="usplistingFact_Insert">
<CFPROCRESULT NAME="getlistingFact" RESULTSET="1">
<CFPROCPARAM CFSQLTYPE="CF_SQL_VARCHAR" TYPE="IN"
VALUE="#txtListing_id#">
<CFPROCPARAM CFSQLTYPE="CF_SQL_VARCHAR" TYPE="IN"
VALUE="#thislistingFact#">
</cfstoredproc>
</cfloop>
</cfoutput>
<!--- <cfoutput>
<cflocation
url="listingForm.cfm?call=edit&txtlisting_id=#txtlisting_id#">
</cfoutput> --->
<cfelseif call is "add">
<cfform name="frmlistingFact" method="post" action="listingFact.cfm">
<cfoutput>
<input type="Hidden" name="txtListing_Id" value="#txtListing_id#">
<input type="hidden" name="type_id" value="#type_id#">
</cfoutput>
<input type="hidden" name="call" value="save">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Please Select A Fact</b></td>
</tr>
<tr>
<td valign="top">Fact</td>
</tr>
<tr>
<td>
<cfquery name="factOutput" datasource="#dsn.listings_v2#" dbtype="ODBC">
SELECT
distinct factType
FROM
fact
WHERE
Type_id = #Type_id#
</cfquery>
<cfoutput>
<input type="hidden" name="factRecord"
value="#factOutput.recordcount#">
<table>
<tr>
<cfloop index="i" from=1 to=#factOutput.recordcount#>
<cfquery name="qrfactType" datasource="#dsn.listings_v2#"
dbtype="ODBC">
SELECT
*
FROM
fact
WHERE
factType = '#factOutput.factType[i]#'
</cfquery>
<td valign="top"><b>#factOutput.factType[i]#</b></td>
<td>
<cfselect name="#factOutput.factType[i]#" size="5"
multiple="Yes"
required="Yes" message="Please Select a Fact">
<cfloop query="qrfactType">
<option value="#fact_id#">#fact#</option>
</cfloop>
</cfselect>
</td>
</cfloop>
</tr>
</table>
</cfoutput>
<br>
</td>
</tr>
<tr>
<td>
<input type="submit" name="btnSubmit" value=" Submit ">
</td>
</tr>
</table>
</cfform>
<cfelseif call is "delete">
</cfif>
</body>
</html>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists