开发者

Mutltiple Column in Value Attribute of CFSELECT

Have searched everywhere and just not sure where to start on this.

I have a cfselect list that requires the value attribute to contain the values from multiple columns in the query. Two ID values are required in order for this select list to function on the needs of the customer.

What is the best way to handle this? On the data side I know that I can combine columns and it works well for the Display attribute. However, on the value one, I am unsure on how to h开发者_如何学Goandle it.


I generally handle this by providing the values as pipe separated values, that I can then parse apart on the server side. So I end up with options like this:

<option value="item1|item2">The First One</option>
<option value="item3|item4">The Second One</option>

As to how to output these, you either have to concatenate them in the SQL, or just use a regular cfoutput tag to manually build the options.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜