开发者

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

开发者 https://www.devze.com 2023-02-08 10:04 出处:网络
Here is what I have inside of my select statement: <cfloop query name=\"country\"> <option value=\"#CountryName#\"><cfoutput>#Cou开发者_如何学PythonntryName#</cfoutput></op

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

精彩评论

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