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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:21:59+00:00 2026-05-25T01:21:59+00:00

I am building a questionnarie that displays two questions at a time. When i

  • 0

I am building a questionnarie that displays two questions at a time.

When i push a radiobutton with the class “MCQRadio” a click handler is fired, but it only works on the first page. The clickhandler for GridRadio works on all pages.

What am i doing wrong?

This is the code:

    <script language="javascript">
    $(document).ready(function()
    {

        $(".page-number").live("click", function()
        {

            var page = parseInt($(this).html());
            var progressbarValue = ((page / $("#NumberOfPages").val()) * 100);
            var catId = $("#CategoryID").val();

            $.ajax(
            {
                url: '@Url.Action("QuestionList")',
                data: {
                    "categoryId": catId,
                    "page": page
                },
                success: function(data)
                {
                    $("#question-list").html(data);
                    $("#progressbar").progressbar("value", progressbarValue);
                    $("#progresstext").html("<p>" + Math.round(progressbarValue) + "% gennemgået</p>");

                }
            });
        });

        $('.MCQRadio').click(function()
        {

            var button = $(this);
            var question_id = button.attr('question-id');
            var mcq_id = button.attr('mcq-id');

            $('#savingquestion').fadeIn();

            $.ajax(
            {
                url: '/SaveSurveyAnswers/SaveMCQAnswer',
                data: {
                    "mcq_id": mcq_id,
                    "question_id": question_id
                },
                success: function(data)
                {
                    button.parent().parent().attr('id', "answered");
                    $('#savingquestion').fadeOut();
                }
            });
        });

        $('.GridRadio').live('click', function()
        {

            var button = $(this);

            var row_id = button.attr('row-id');
            var column_id = button.attr('column-id');
            var question_id = button.attr('question-id');

            $('#savingquestion').fadeIn();

            $.ajax(
            {
                url: '/SaveSurveyAnswers/SaveGridAnswer',
                data: {
                    "row_id": row_id,
                    "column_id": column_id,
                    "question_id": question_id
                },
                success: function(data)
                {

                    // Hvis ActionControlleren returnerer complete, betyder det at spørgsmålet er fuldt besvaret.
                    // Hvis dette er tilfældet, skal id på den omringende table og div ændres, således at der kommer
                    // de rigtige farver for besvarede spørgsmål
                    $('#savingquestion').fadeOut();

                    if (data == "complete")
                    {
                        var table = button.closest('table');
                        var div = button.closest('div');

                        if (table.attr('id') != "answeredTable")
                        {
                            table.attr('id', 'answeredTable');
                        }
                        if (div.attr('id') != "answered")
                        {
                            div.attr('id', 'answered');
                        }
                    }
                }
            });

        });

    });

  • 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-05-25T01:22:00+00:00Added an answer on May 25, 2026 at 1:22 am

    The function for the MCQRadio is not a live function, just a normal click function. I am guessing that it should also be a live function.

    This

    $('.MCQRadio').click(function()
    

    should be

    $('.MCQRadio').live('click', function()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a questionnarie. It displays two questions at a time. The questions
Building a multilingual application that should work with the most prevalent global alphabets but
Building a quick view that will display a list of all days but only
Building a Silverlight 5 app that runs in the browser but getting some nagging
building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
Building an iPhone OS application that will allow users to anonymously post information to
building libraries with waf is nice and I like the lib<targetname> naming scheme. But
Building a commercial product may use various open source libraries that have use of
I am building a questionnaire, and i want to save the number of questions

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.