我无法在我的页面上查看单选选项。他们不会检查是或否。
for (var i = 0; i < r.length; i++) {
jQuery('#condition-'+i+'-price').val(r[i].price);
jQuery('#condition-'+i+'-bid').val(r[i].bid);
console.log('[value='+r[i].on_amazon+']');
console.log(jQuery('#condition-'+r[i].condition_id+'-on_amazon').filter('[value='+r[i].on_amazon+']'));
jQuery('#condition-'+r[i].condition_id+'-on_amazon').filter('[value='+r[i].on_amazon+']').attr('checked', true);
}
r[i].on_amazon 始终为 1 或 0,并且 condition_id 正确,因为价格/出价成功更新...
<tr>
<td><label for="on_amazon-1-yes">Yes</label></td>
<td class="yes"><input type="radio" id="condition-1-on_amazon" value="1"></td>
<td> </td>
<td class="no"><input type="radio" id="condition-1-on_amazon" value="0"></td>
<td><label for="on_amazon-1-no">No</label></td>
</tr>