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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:05:38+00:00 2026-06-07T05:05:38+00:00

I have an application [here][1] where an user is able to select their options

  • 0

I have an application [here][1] where an user is able to select their options and answers. Please follow steps below in application.

  • Step 1: When you open application, you will see the “Open Grid” link,
    click on it and select an option type, after you select an option it
    will display the answer buttons at the bottom. For example if the
    option you choose is “5”, it will display 5 answer buttons “A – E”,
    if option chose is 8, it will display 8 answer buttons “A-H”.

Now this is fine. As you can see the correct amount of answer buttons appear depending on the option chosen from the grid. But the problem I have is if the user wants to add a previous option. please look at steps below:

  • Step 2: You will see a green plus button on left hand side, click on
    it, this will open up a modal window.
  • Step 3: In the search box type in “AAA” and then click on “Submit”
    button, it will display rows from the database.
  • Step 4: If you look at the first row you can see that under “Option Type” column, it is A-D. Select this row by clicking on the “Add” button.

What will happen is that the
modal window will close and if you look at the answer and option
control on the right hand side, you can see that the Option Type
textbox contains the number 4 (This is because Option Type was “A-D” so there are 4 options “A,B,C,D”), so it should display answer buttons A-D but it doesn’t, it doesn’t change the answer buttons at all, they remain the same.

So my question is how can I get the correct Answer buttons to appear after the user has clicked on the “Add” button?

Below is the code where it imports the answer buttons after an option is selected from the grid:

  $('.gridBtns').on('click', function()

            {

    var clickedNumber = this.value;

        $(this).closest('.option').siblings('.answer').find('.answers').each(function(index) {
    if (!isNaN(clickedNumber) && index < clickedNumber) {
    $(this).show();


    } else {

    $(this).hide();
    $(this).removeClass('answerBtnsOn');
    $(this).addClass('answerBtnsOff');

    }

    var $this = $(this);
    var context = $this.parents('.optionAndAnswer');
    console.log($this);


                });

if (clickedNumber === 'True or False') {

  $(this).closest('.option').siblings('.answer').find('input[name=answerTrueName]').show();
   $(this).closest('.option').siblings('.answer').find('input[name=answerFalseName]').show();

} else if (clickedNumber === 'Yes or No') {

      $(this).closest('.option').siblings('.answer').find('input[name=answerYesName]').show();
      $(this).closest('.option').siblings('.answer').find('input[name=answerNoName]').show();  

 }




                getButtons();

            });


        });

    function getButtons()
    {
        var i;
        if (initClick == 0) {
for (i = 65; i <= 90; i++) { // iterate over character codes for A to Z
$("#answer" + String.fromCharCode(i)).removeClass("answerBtnsOn").addClass("answerBtnsOff");

            }

            initClick = 1;
        }
// code above makes sure all buttons start off with class answerBtnsOff, (so all button are white).
    }

Below is function where it controls what happens after the “Add” button has been clicked on:

    function addwindow(numberAnswer,gridValues) { 

        if(window.console) console.log();

        if($(plusbutton_clicked).attr('id')=='mainPlusbutton') { 


            $('#mainNumberAnswerTxt').val(numberAnswer);
            $('#mainGridTxt').val(gridValues);
            } else { 
$(plusbutton_clicked).closest('tr').find('input.numberAnswerTxtRow').val(numberAnswer);
$(plusbutton_clicked).closest('tr').find('input.gridTxtRow').val(gridValues);
                }

        $.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-07T05:05:40+00:00Added an answer on June 7, 2026 at 5:05 am

    After analyzing your above code as well as HTML source code of link you gave, looks like you are just one step behind. You are only assigning the grid value(4 in above case) to in mainGridTxt input box. You need to trigger the click event on the grid buttons.

    Put the below code after $model.close

    $('#btn'+gridValues).trigger('click');
    

    Above code will trigger the click event on grid button with id ‘btn4’.

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

Sidebar

Related Questions

In my application I need a user to be able to select a row
I have written an application (using Delphi 2009) that allows a user to select
Here's the situation: the user is able to sign into a MVC application from
Our application requires a user to select a photograph from their camera. The cameras
I have a Jsfiddle application here . If you type in a question in
here is a good question: I have an application compiled for iPhone OS 2.21.
Here is the scenerio: We have an application running on Webphere Portal Server 6.1
I have an application I need to analyze. I have the source code here.
Kinda stuck here... I have an application with lets say 5000 rows of data
I think I am at a impasse here. I have an application I built

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.