Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:14:16+00:00 2026-06-12T10:14:16+00:00

$(document).ready(function() { var ttline2 = $(‘#FIELD_’ + FieldIDS[‘TT_Line2’]); ttline2 = $(‘#FIELD_’ + FieldIDS[‘BadgeHolder’]; +

  • 0
$(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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:14:17+00:00Added an answer on June 12, 2026 at 10:14 am

    .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

    $(document).ready(function() {
         var ttline2 = $('#FIELD_' + FieldIDS['BadgeHolder']).val() 
             + $('#FIELD_' + FieldIDS['strap_clip']).val() 
             + $('#FIELD_' +  FieldIDS['Lanyard']).val();
    
         $('#FIELD_' + FieldIDS['TT_Line2']).val(ttline2);
     });​
    

    UPDATED CODE
    If you want to add numbers you need to parse them first as the values are stored as string.

    var FieldIDS = { 'BadgeHolder' : 'Badge'  , 'strap_clip' : 'Clip' , 'Lanyard' : 'Yard' , 'TT_Line2' : 'Line'};
    
    $(document).ready(function() {
         var ttline2 = parseInt($('#FIELD_' + FieldIDS['BadgeHolder']).val())
             + parseInt($('#FIELD_' + FieldIDS['strap_clip']).val()) 
             + parseInt($('#FIELD_' +  FieldIDS['Lanyard']).val());
    
         $('#FIELD_' + FieldIDS['TT_Line2']).val(ttline2);
        });​
    

    UPDATED DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(document).ready(function(){ $(.role).change(function(){ var userId=$(this).attr('name'); return $(form[id=userId]).submit(); }); }) In the above code, I already
I have the following code: $(document).ready(function() { var id = 'cbx'; var idPrefix =
I have the following JQuery code: $(document).ready(function () { var $containerHeight = $(window).height(); if
I have the code below: $(document).ready(function() { var bgimages=new Array() bgImages[0]=bg.jpg bgImages[1]=bg2.jpg //sloppy preload
My code: $(document).ready(function() { $('.tags').hover(function() { var id = this.id; $.post(tag_process.php, { tag: id
Here's my code: $(document).ready(function () { var default_var = 2; var show_var = default_var;
I have this javascript code: $(document).ready(function() { var leftHeight = $('#maincontent').height(); $('#sidemenu').css({'height':leftHeight}); }); This
I have this code: $(document).ready(function() { var MidUpperArmCircumference = 0; var TricepsSkinfold = 0;
This is simple code - $(document).ready(function() { var genvalue=; $(input:radio[name=gender]).click(function() { genvalue = $(this).val();
I have the following jQuery code: $(document).ready(function(){ var ac_config = { source: autocomplete-delta.php, select:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.