Javascript 如何在循环中设置默认的无线电值?
我有一个循环查询,我想做的是显示 每个无线电值的“额定值”中的值 倾销我得到的值(5,4.5,5,5) 因此,对于我想在单选按钮中默认的每个值 我犯了一个错误 我怎样才能用下面的表格完成这项工作Javascript 如何在循环中设置默认的无线电值?,javascript,coldfusion,Javascript,Coldfusion,我有一个循环查询,我想做的是显示 每个无线电值的“额定值”中的值 倾销我得到的值(5,4.5,5,5) 因此,对于我想在单选按钮中默认的每个值 我犯了一个错误 我怎样才能用下面的表格完成这项工作 <table> <thead> <tr><th>1</th><th>2</th><th>3</th><th>4</th><th>question<
<table>
<thead>
<tr><th>1</th><th>2</th><th>3</th><th>4</th><th>question</th></tr>
</thead>
<tbody>
<cfloop index="i" from="1" to="4">
<cfset rating = Mush2["rating" & i][Mush2.CurrentRow]>
<cfset question = Mush2["csedept_question" & i][Mush2.CurrentRow]>
<tr>
<cfdump var=#rating#>
<td valign="top">
<input type="radio" name="rating1#i#row#CurrentRow#" value="5">
</td>
<td valign="top">
<input type="radio" name="rating2#i#row#CurrentRow#" value="4.5">
</td>
<td valign="top"><div align="center">
<input type="radio" name="rating3#i#row#CurrentRow#" value="4">
</td>
<td valign="top">
<input type="radio" name="rating4#i#row#CurrentRow#" value="3.5">
</td>
<cfif i is 1>
<td><strong>testing </strong><br/>
<span class="description">test</span>
</td>
</cfif>
<cfif i is 2>
<td><strong>testing</strong><br/>
<span class="description">test</span>
</td>
</cfif>
<cfif i is 3>
<td><strong>testing</strong><br/>
<span class="description">test</span>
</td>
</cfif>
<cfif i is 4>
<td><strong>testing</strong><br/>
<span class="description">test.</span>
</td>
</cfif>
</tr>
</cfloop>
</tbody>
</table>
1234问题
测试
测试
测试
测试
测试
测试
测试
测试。
这应该行得通
<cfloop list="#rating#" index="oneRating">
<td valign="top">
<div align="center">
<input type="radio" name="rating1#i#row#CurrentRow#" value="#oneRating#">
</div><br>
</td>
</cfloop>