我不确定为什么这个给我“未定义”。imgNames 在那里。
<cfquery name="getArt" datasource="cfartgallery">
select * from art where artid < 10
</cfquery>
<cfdump var="#getArt#">
<cfform name="myform" width="620" height="750" format="Flash" timeout="100" preservedata="yes" wmode="transparent">
<cfformitem type="script">
function updateSelectedArt():Void{
var elem;
var imgName;
var values = [];
var total = parseInt(myform.pickmany_total);
for (var i = 1; i <= total; i++) {
elem = _root["pickmany"+ i];
imgName = _root["img"+ i];
if (elem.selected) {
values.push(imgName.value);
}
}
// use whatever delmiter makes sense
_root["pickmany_selected"].text = values.join(",");
}
</cfformitem>
<cfoutput query="getArt">
<cfinput name="pickmany#currentRow#" type="checkbox" value="#artname#" onClick="updateSelectedArt()" label="#artname#"><br/>
<cfinput name="img#currentRow#" type="text" value="#largeImage#"><br/>
</cfoutput>
<cfinput type="hidden" name="pickmany_total" value="#getArt.recordCount#">
<cfinput type="text" name="pickmany_selected" value="" size="50">
</cfform>