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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:31:48+00:00 2026-06-01T15:31:48+00:00

I need a checkbox, where you move from one page to another after clicking

  • 0

I need a checkbox, where you move from one page to another after clicking the box. The checkbox should be required, given that you’ve read the terms and conditions link next to it.

I’m only half sure how to do this, something like this:

<input type="checkbox" value="confirm_prepay_terms" name="confirm_prepay_terms" align="middle" />

with Jquery:

<script type="text/javascript" language="javascript">
$(document).ready(function() {
        if ($('form#prepay input:checkbox', 'confirm_prepay_terms').is(':checked') {
                return true;
        } else {
            $('#confirm_terms_hint').text('Please try again - you need to check the box to move on');
            $('#confirm_terms_hint').css('font-weight', 'strong');
            return false;
        }
}
</script>

At the moment though, I can’t view the checkbox at all on the page, so perhaps my HTML is incorrect?

Hope you can help.

  • 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-01T15:31:50+00:00Added an answer on June 1, 2026 at 3:31 pm

    Your HTML is fine – is will show a checkbox – but without any text. You could add some using this markup :

    <input type="checkbox" value="confirm_prepay_terms" name="confirm_prepay_terms" align="middle" >​Text here</input>​​​​​​​​​​​​​​​​​​​​​​​
    

    In your JavaScript you are missing a closing ) :

    if ($('form#prepay input:checkbox', 'confirm_prepay_terms').is(':checked') {
    

    should be

    if ($('form#prepay input:checkbox', 'confirm_prepay_terms').is(':checked')) {
    

    and a ) on the last line :

    }
    </script>
    

    should be

    })
    </script>
    

    and your selector is incorrect

    $('form#prepay input:checkbox', 'confirm_prepay_terms')
    

    should be

    $('form#prepay input:checkbox[name=confirm_prepay_terms]')
    

    This uses the multiple attribute selector

    and

    $('#confirm_terms_hint').css('font-weight', 'strong');
    

    should be

    $('#confirm_terms_hint').css('font-weight', 'bold');
    

    font-weight has no strong value (see here) … use bold instead

    in your script you are returning true or false but the code is not being called by anything – its executing as soon as the page has completed loading. Have a look at the .submit() method in jQuery if you want to perform form validation. An example would be this :

    $(document).ready(function() {
        $('#prepay').submit(function() {
            if ($('form#prepay input:checkbox[name=confirm_prepay_terms]')) {
                    return true;
            } else {
                $('#confirm_terms_hint').text('Please try again - you need to check the box to move on');
                $('#confirm_terms_hint').css('font-weight', 'bold');
                return false;
            }
        });
    });
    

    This would prevent the form from being submitted now – as you return false to the submit event.

    Fully working example here

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

Sidebar

Related Questions

I need a silverlight checkbox with the box that holds the checkmark much smaller(10px
I need to know if more than one checkbox is selected from my list.
I need CSS selector that match all input tags where type is not checkbox
I need a sort of live effect on some checkbox - I need that
I need every checkbox of class 'bad' that will be added to the DOM
I need to move a table row from a position to the first in
I need to find a checkbox with a class that is contained within the
I need to generate checkbox group based on data from DB, so I fetch
I need a I accept terms of service checkbox on a page, it has
I need to get the value from a checkbox which is not hidden. Here

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.