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 8649641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:36:41+00:00 2026-06-12T13:36:41+00:00

I have an application you can use below but basically it is a text

  • 0

I have an application you can use below but basically it is a text input not changing after the user adds information from a row.

Here is the application:

Application

Please follow the steps below:

1: When you open the application, You will see a “Add Question” button, click on this button and you will see a table row appended underneath.

2: Within the appended row, click on the buttons “B” and “C”, these buttons will turn green meaning they are on and underneath you will see 2 text inputs appear showing the values of the buttons you have turned on.

3: You will see a green plus button on the left hand side of the row. Please click on this button and you will see a modal window appear.

4: You will see a search bar in the modal window, in the search bar type in “dog” and then click on the search button.

5: A row will appear which is relevant from your search, please click on the “Add” button on the right hand side to add the info.

6: You will see in the appended row that now button “A” is highlighted and the other buttons are off.

But the problem is that the text inputs underneath has not changed. IT still displays text inputs for values “B” and “C”, which is incorrect, as button “A” is turned on and is the only button turned on, it should only display as text input for button “A”, the other text inputs should be removed.

So my question is that how after the user has added information from the modal window that it changes the text inputs to only display the value of the buttons which are turned on?

Below is the code where it updates the answer buttons:

    updateAnswer(context , iQuestionIndex, bDisableAppend);

    var container = $btn.closest(".optionAndAnswer");
    $(".answertxt", container).val( $(".answerBtnsOn", container).length );

    return false;
}


function updateAnswer(context, iQuestionIndex, bDisableAppend) {
    var _sCurrQ_Class = 'q_' + iQuestionIndex;
    var _oCurrAnswerContainer = jQuery('#answer_selections .' + _sCurrQ_Class);
    if (!_oCurrAnswerContainer.length) {
        _oCurrAnswerContainer = jQuery(document.createElement('div')).addClass(_sCurrQ_Class);
        !bDisableAppend && jQuery('#answer_selections').append(_oCurrAnswerContainer);
    }

    _oCurrAnswerContainer.html('');

    var value, id;
    // loop through all buttons with 'on' status and their info to the current answer container
    $('.answerBtnsOn', context).each(function(i, btn) {

        var $btn = $(btn);
        value = btn.value;
        id = $btn.attr('id');

        var n = $("input[name='" + id + "value']").length;
        var hid = "hidden" + id + n + "value";    
        $(btn).attr("data-hid", hid);


        if (!bDisableAppend) {
            // append those values to the form
            var input = '<input type="text" id="' + hid + '" value="' + value + '" name="' + id + 'value" />';
            _oCurrAnswerContainer.append(input);
        }
    });        
}

Below is the code where it controls the modal window and everything in it:

function addwindow(btn) {

    var answers = $.map(btn.split(''),function(chr){   return "#answer"+chr;  }).join(', 
    var answersrow = $.map(btn.split(''),function(chr){   return "#answer"+chr+"Row";  }).join(', ');
}



    if($(plusbutton_clicked).attr('id')=='mainPlusbutton') { //green plus button at top of application


        $('#answerSection').find('.answerBtnsOn').removeClass('answerBtnsOn').addClass('answerBtnsOff');
        $(answers).addClass("answerBtnsOn").siblings().addClass('answerBtnsOff');

        } else { 
//green plus button within an appended row
            $(plusbutton_clicked).closest('tr').find('.answerBtnsOn').removeClass('answerBtnsOn').addClass('answerBtnsOff');
            $(plusbutton_clicked).closest('tr').find(answersrow).addClass("answerBtnsOn").siblings().addClass('answerBtnsOff');

            }

    $.modal.close(); 
    return false;
} 
  • 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-12T13:36:43+00:00Added an answer on June 12, 2026 at 1:36 pm

    As I mentioned in a comment, use updateAnswer to update the text inputs.

    You need to send in the node that contains all of the buttons for that answer. In the addwindow I think it should be $(plusbutton_clicked).closest('tr'). You also need to send in the question index somehow.

    It would perhaps be easier if you attached a few data attributes to some elements to simplify retrieving various values instead of creating classes for each one.

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

Sidebar

Related Questions

I have a web application that you can use to import information from another
Currently I have a web application where a user can use dropdown lists to
i have this application but how to use its? and example for 7-zip can?
We have a .net application that we didn't develop, but use. I can tell
I have a test application here which you can use: Please follow steps below
I have a socket application which I can use in local network, at home.
All, I have my application setup so that i can use a specific username
In my application I have scenario like below. User downloads our application exe and
I have an application that can filter a datagridview based on date using a
I have an application that can be viewed with landscape and portrait mode. I'm

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.