开发者

Problem with the value portion of a drop down menu in ColdFusion

Here is what I have inside of my select statement:

<cfloop query name="country">
    <option value="#CountryName#"><cfoutput>#Cou开发者_如何学PythonntryName#</cfoutput></option>
</cfloop>

Everything works fine, but the value it passes to my URL filter is #CountryName#, not the actual country name (i.e. Canada).

How can I assign it the value of the country name and not the variable name?


The #CountryName# variable is not being evaluated because it is outside your output tags. Move the tags so they encompass your value too.

<cfoutput><option value="#CountryName#">#CountryName#</option></cfoutput>

Or just use a <cfoutput query="..."> instead of <cfloop>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜