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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:21:36+00:00 2026-05-31T13:21:36+00:00

I’m trying to create a single multiple choice question. In the example below, I

  • 0

I’m trying to create a single multiple choice question.

In the example below, I would like option 1 and 3 to be the correct answer. When the submit button is clicked, i just wanted to run an if statment to see if the option 1 and 3 checkboxes are selected, and if so, toggle the correct1 div. Else if, option 1 and 3 are not selected, toggle the incorrect1 div.

in the Head tag I would have

<script type="text/javascript">
    function toggleDiv2(divId) {
    $("#"+divId).toggle("slow");
            }
</script>

Then in the body i would have:

<div class="control-group">

            <label class="control-label" for="optionsCheckboxList">Check your answers</label>
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox" id="option1" name="optionsCheckboxList1" value="option1">
                <strong>Option One</strong> this is a correct answer. Select this one.
              </label>
              <label class="checkbox">
                <input type="checkbox" id="option2" name="optionsCheckboxList2" value="option2">
                <strong>Option two</strong>  this is an incorrect answer. Do not select this one.
              </label>
              <label class="checkbox">
                <input type="checkbox" id="option3" name="optionsCheckboxList3" value="option3">
                <strong>Option three</strong>  This is a correct answer. Select this one.
              </label>
              <p class="help-block"><strong>Hint:</strong> Add a hint if you would like. This is optional.</p>
          <br>


        <a href="javascript:toggleDiv2('correct1');" class="btn btn-primary">Submit</a>

          <br><br>

            <div id="correct1" class="alert alert-success" style="display: none">
            Well Done! You correctly answered this question!
            </div><!-- end correct1 -->

            <div id="incorrect1" class="alert alert-error" style="display: none">
            Oh snap! Please try again.
            </div><!-- end incorrect1 -->
            </div><!-- end control-group -->

Not sure if this matters or not, but this is the jquery the page is linking to:

<script src="html/assets/js/jquery-ui-1_8_18custom/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="html/assets/js/jquery-ui-1_8_18custom/js/jquery-ui-1.8.18.custom.min.js" type="text/javascript" ></script>
  • 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-31T13:21:37+00:00Added an answer on May 31, 2026 at 1:21 pm

    This got it working…

    <script type="text/javascript">
       function toggleDiv2() {
       if($("#option1").is(':checked') && $("#option3").is(':checked'))
       $("#correct1").toggle("slow");
        else
       $("#incorrect1").toggle("slow");
       }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

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.