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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:06:46+00:00 2026-06-10T04:06:46+00:00

I have 3 checkoxes and a submit button: <form id=form1 action=/controller/action method=post> <div class=checkbox><input

  • 0

I have 3 checkoxes and a submit button:

<form id="form1" action="/controller/action" method="post">
            <div class="checkbox"><input type="checkbox" name="box1" class="cBox" /><label for="box1" class="label">Box1</label></div>
            <div class="checkbox"><input type="checkbox" name="Box2" class="cBox" /><label for="Box2" class="label">Box2</label></div>
            <div class="checkbox"><input type="checkbox" name="Box3" class="cBox" /><label for="Box3" class="label">Box3</label></div>
            <input type="submit" value="Submit" />
</form>

I have the following jquery which alerts “Please tick all checkboxes!” when no checkboxes been ticked:

$(document).ready(function() {
    $('#form1').submit(function() {
        if ($('input:checkbox', this).is(':checked')) {
            // everything's fine...
        } else {
            alert('Please tick all checkboxes!');
            return false;
        }
    });
});

Using jQuery I need:

If all checkboxes have been ticked, once the submit button is clicked alert: “All checkboxes have been ticked”.

If all checkboxes have not been clicked then alert: “Please tick all checkboxes!” on submit.

thanks

  • 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-10T04:06:48+00:00Added an answer on June 10, 2026 at 4:06 am

    You can check if the number of checkboxes are the same number as the number of checked ones:

    $(document).ready(function() {
        $('#form1').submit(function() {
            if ($('input:checkbox', this).length == $('input:checked', this).length ) {
                // everything's fine...
            } else {
                alert('Please tick all checkboxes!');
                return false;
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form as <form method=post action=target.php> <input class=button type=submit value=Submit />
I have the following html code : <form name=uploadForm action= method=POST enctype=multipart/form-data> <input type=file
I have code like so: <form enctype=multipart/form-data method=POST action=blabla.php class=addToCart> <input type=button onclick=addToCartMulti(); value=Add
I have a web page like this: <form id=some-form> <input type='text'> <button type=submit> </form>
I have a simple form. Input fields, checkboxes, radio buttons and finally SUBMIT button.
For example, i have checkboxes: <input type='checkbox' name='fruit' value='apple'> Apple <input type='checkbox' name='fruit' value='orange'>
I have a form with three radio button options, and a submit button (no
<!DOCTYPE html> <html> <body> <form action=form_action.asp method=get> <span style='background-color: red;'> <input style=FILTER: progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=50);
I have a page with some checkboxes and a submit button. I use AJAX
I want to submit a form that have many checkboxes with different values, using

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.