$(document).ready(function() {
var ttline2 = $('#FIELD_' + FieldIDS['TT_Line2']);
ttline2 = $('#FIELD_' + FieldIDS['BadgeHolder']; + $('#FIELD_' + FieldIDS['strap_clip']; + $('#FIELD_' + FieldIDS['Lanyard'];
});
所以我上面的代码是这样的。我有3个单选按钮,每个单选按钮都有一个值,每个值需要添加到一个输入字段,输入字段是TT_Line2。我可以使用 $('#FIELD_' + FieldIDS['Lanyard']; 调用特定字段。在 JSLINT 上,它说使用点表示法会更好。
问题,我无法将其传递给输入字段。还是新的形式填充。
这是我的 HTML 代码
<tbody><tr valign="top" style="width: 125px; "><td style="width: 125px"><input type="radio" name="FIELD_1366" id="FIELD_1366" value="No"><span>No</span>
</td>
</tr>
<tr valign="top" style="width: 125px; "><td style="width: 125px"><input type="radio" checked="" name="FIELD_1366" id="FIELD_1366" value="BadgeHolder"><span>Yes</span>
</td>
</tr>
</tbody>
<tbody><tr valign="top" style="width: 125px; "><td style="width: 125px"><input type="radio" name="FIELD_898" id="FIELD_898" value="No"><span>No</span>
</td>
</tr>
<tr valign="top" style="width: 125px; "><td style="width: 125px"><input type="radio" checked="" name="FIELD_898" id="FIELD_898" value="BulldogClip"><span>Yes</span>
</td>
</tr>
</tbody>
<tbody><tr valign="top" style="width: 200px; "><td style="width: 200px"><input type="radio" name="FIELD_1276" id="FIELD_1276" value="No"><span>No</span>
</td>
</tr>
<tr valign="top" style="width: 200px; "><td style="width: 200px"><input type="radio" checked="" name="FIELD_1276" id="FIELD_1276" value="White"><span>White</span>
</td>
</tr>
<tr valign="top" style="width: 200px; "><td style="width: 200px"><input type="radio" name="FIELD_1276" id="FIELD_1276" value="Black"><span>Black</span>
</td>
</tr>
</tbody>
<div class="fieldSpacer" id="DIV_119"><p class="fieldSpacer">JDELITM</p><p><input value="50-D-EXPKOE-V-F" style="width: 200px; " name="FIELD_119" id="FIELD_119"></p>
<script language="javascript">
FieldIDs["JDELITM"] = 119;
</script>
<div id="VALID_VAR_119" style="display:none" class="validationError"></div>
</div>