Groups | Blog | Home
all groups > coldfusion flash integration > july 2005 >

coldfusion flash integration : CFSELECT Help!!


bal_logicmanager
7/7/2005 12:49:32 PM
bal_logicmanager
7/8/2005 12:00:00 AM
The ScareCrow
7/8/2005 1:16:21 PM
Need more information.

What and Where is the data coming from to populate the other form fields ?

The ScareCrow
7/9/2005 12:00:00 AM
Attached is some code that will get you on your way

Ken

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--- Create a new three-column query, specifying the column data types --->
<cfset myQuery = querynew("Name, Time, Advanced", "VarChar, Time, Bit")>

<!--- Make two rows in the query --->
<cfset newRow = QueryAddRow(MyQuery, 2)>

<!--- Set the values of the cells in the query --->
<cfset temp = QuerySetCell(myQuery, "Name", "The Wonderful World of CMFL", 1)>
<cfset temp = QuerySetCell(myQuery, "Time", "9:15 AM", 1)>
<cfset temp = QuerySetCell(myQuery, "Advanced", False, 1)>
<cfset temp = QuerySetCell(myQuery, "Name", "CFCs for Enterprise
Applications", 2)>
<cfset temp = QuerySetCell(myQuery, "Time", "12:15 PM", 2)>
<cfset temp = QuerySetCell(myQuery, "Advanced", True, 2)>

<html>
<head>
<title>Untitled</title>
</head>
<cffunction name="trace" output="Yes">
<cfargument name="itemToTrace">
<cfargument name="itemToTrace1">
<cfargument name="itemToTrace2">
<cfsavecontent variable="mreturn">
var arrName:Array = [];
var arrTime:Array = [];
var arrAdvanced:Array = [];

<cfloop list="#itemToTrace#" index="i">
arrName.push(#i#);
</cfloop>
<cfloop list="#itemToTrace1#" index="x">
arrTime.push(#x#);
</cfloop>
<cfloop list="#itemToTrace2#" index="y">
arrAdvanced.push(#y#);
</cfloop>
for(var k = 0; k < arrName.length; k++){

if(myselect.selectedItem.data == arrName[k]){
txt_time.text = arrTime[k];
txt_advanced.text = arrAdvanced[k];
}
}
</cfsavecontent>
<cfreturn mreturn>
</cffunction>

<body>


<cfset colName = ListQualify(ValueList(myQuery.Name, ','), '"', ',', 'All')>
<cfset colTime = ListQualify(ValueList(myQuery.Time, ','), '"', ',', 'All')>
<cfset colAdvanced = ListQualify(ValueList(myQuery.Advanced, ','), '"', ',',
'All')>

<cfform action="" method="POST" format="Flash">
<cfformgroup type="VERTICAL">
<cfselect name="myselect" width="200" queryposition="above" query="myQuery"
value="Name" display="Name" visible="Yes" enabled="Yes"
onchange="#trace('#colName#','#colTime#','#colAdvanced#')#">
<option value="select" selected>select</option>
</cfselect>
<cfinput type="Text" name="txt_time" value="" width="100" required="No"
visible="Yes" enabled="Yes">
<cfinput type="Text" name="txt_advanced" value="" width="100" required="No"
visible="Yes" enabled="Yes">
</cfformgroup>
</cfform>

</body>
</html>
AddThis Social Bookmark Button