使用 ColdFusion 访问文本字段循环中的数据
我对 ColdFusion 相当陌生,不太了解变量访问的工作原理。我创建了一个表,该表生成许多名为 condesc#i# 的文本字段,其中 i 是 cfloop 中的当前索引。
然后我有第二个循环,尝试访问已创建的每个字段的内容。我尝试使用 #condesc#i## 进行访问,但没有成功。
我应该如何从这些字段获取信息?
I am fairly new to ColdFusion, and don't quite understand how variable access works. I've created a table that generates a number of text fields named condesc#i#, where i is the current index in a cfloop.
I then have a second loop, that attempts to access the contents of each field that has been created. I have attempted to make access using #condesc#i##, but with no success.
How should I go about getting the information from these fields?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所有变量都是结构,因此您可以像这样访问它们:
并动态构建键。
All variables are structures so you can access them like this:
And dynamically build the keys.
您可以使用括号表示法和字符串连接来引用动态变量名称:
You can reference dynamic variable names by using bracket notation and string concatenation: