循环复选框Coldfusion

时间:2018-01-25 17:47:53

标签: list coldfusion cfloop

我有一个带复选框值的循环。

<cfloop list="form.check_values" index="i" delimiters=",">
</cfloop>

问题是,当我循环列表结果时,如:

enter image description here

如何循环该列表以产生类似查询循环的内容:

enter image description here

1 个答案:

答案 0 :(得分:1)

看起来你想要的是

<cfquery name="result">
    SELECT idEstado, nombreEstado
    FROM   sometable
    WHERE  idEstando IN (<cfquery cfsqltype="CF_SQL_INTEGER" value="#form.check_values#" list="true">)
    ORDER BY idEstado
</cfquery>