$(document).ready(function() {
var ttline2 = $('#FIELD_' + FieldIDS['TT_Line2']);
ttline2 = $('#FIELD_' + FieldIDS['BadgeHolder']; + $('#FIELD_' + FieldIDS['strap_clip']; + $('#FIELD_' + FieldIDS['Lanyard'];
});
So my above code goes like this.
I have 3 radio buttons, each radio button has a value, each value needs to add to a input field, the input field is TT_Line2. I can call to a specific field using $(‘#FIELD_’ + FieldIDS[‘Lanyard’];. On JSLINT it says it would be better to use dot notation.
Issue,
I cant get this to pass to the input field. Still new to form filling.
here is my HTML code
<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>
.val is messing it up..
It should be .val() Instead… Also You are missing some closing braces )
Also you are reading textvalue and saving in in a variable… Storing value into the variable does not mean the value automatically gets updated.. You need to set it explicitly.
Try this code
UPDATED CODE
If you want to add numbers you need to parse them first as the values are stored as string.
UPDATED DEMO