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

  • SEARCH
  • Home
  • 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 8244791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:58:22+00:00 2026-06-07T21:58:22+00:00

Hi I have the following html code <td> Question1 <input type=radio value=1 name=1 id=1_1>Agree

  • 0

Hi I have the following html code

<td>
  Question1
   <input type="radio" value="1" name="1" id="1_1">Agree
   <input type="radio" value="2" name="1" id="1_2">Dis-Agree
  <input type="text" size="30" name="1[answer]" id="1_answer" class="answer">
</td>
<td>
  Question2
   <input type="radio" value="1" name="2" id="2_1">Agree
   <input type="radio" value="2" name="2" id="2_2">Dis-Agree
  <input type="text" size="30" name="2[answer]" id="2_answer" class="answer">
</td>
<input type="text" size="30" name="feedback[answers]" id="feedback_answers">

What I want to do is

  • When user clicks on the radio button it gets the selected value and
    set in text box along with the question (Ex: 1_answer)
  • Meanwhile I want to append the same value to the ‘feedback_answers’
    text box

I was manage to the first steps, but I cannot get the values from Ex: 1_answer text box to ‘feedback_answers’ text box, following is my JQuery code

$(document).ready(function() {

    $("input:radio[type=radio]").click(function() {
       id = $(this).attr('id');
       ids = id.split("_")
       question_id = ids[0]
       answer_id = ids[1]
       $('#' + question_id + '_answer').val(answer_id);
       $(".answer").each(function(index, value){
         alert(this.val)
       });  
});

can someone help me, I want to loop through all the ‘asnwer’ text boxes (Ex: 1_answer) and get all of them to ‘feedback_answers’ text box.

thanks in advance

  • 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-07T21:58:25+00:00Added an answer on June 7, 2026 at 9:58 pm

    Try This

    $(document).ready(function() {
        var feedback_answers = $("#feedback_answers");
        $("input[type=radio]").click(function() {
           var id = $(this).attr('id');
           var ids = id.split("_")
           var question_id = ids[0]
           var answer_id = ids[1];
           var answers = [];
           $('#' + question_id + '_answer').val(answer_id);
           $(".answer").each(function(index, value){
              //alert($(this).val())
              answers.push($(this).val());
           });  
           feedback_answers.val(answers.join());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a textbox in HTML using the following code: <input type=text name=text
I have some code like the following: <html> <body> <div id=product_descriptioncontent> <input type=text id=a
I have the following html code: <form> <table> <tbody> <tr> <td> <span>Quantity<span class=pull-right>3</span> <input
I have the following html code: <mytag> Just Some Text </mytag> And I have
I have the following files: view.jsp <@ page import=... <bean:define id=mForm name=myForm type=MyForm/> <html:form
Just a (hopefully) quick question, I have the following HTML code: <tr> <td><img src=img/icons/file_pdf.png></td>
I have the following html code: I saw that for Watir-webdriver the Watir::Image.file_size method
I have the following html code with Jquery Sorting <div class=sortable style='width:700px; margin: 0
I have the following html code. <html> <body> <div style=max-width:1600px; min-width:900px; > <table> </table>
I have the following html code (in the given order) <div id=content>...</div> <div id=footer>...</div>

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.