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

  • Home
  • SEARCH
  • 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 8950699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:29:57+00:00 2026-06-15T13:29:57+00:00

I have one form and in that form I have many checkboxes and that

  • 0

I have one form and in that form I have many checkboxes and that checkboxes are categorised it in 2 category and when I select one category all its subcategory checkbox get selected automatically and I used On submit button as filter which filter the options according to chekbox selected.

For Ex:-
I have check-boxes as

                               1]Alcoholic Drinks
                               2]--Beer 
                               3]--Rum
                               4]--Whiskey
                               5]Non Alcoholic Drinks
                               6]--Coffee
                               7]--Tea
                               8]--Juice  

I am using jquery to check-box get selected automatically.
Suppose user ticks on Alcoholic then automatically its subcheckbox get selected.

My Code:-

        $('#Alcoholic').click(function() 
             {                                    

                  if( $(this).attr("checked"))
                 {  

                   $(this).parents('.min-form').find('label.Beer').removeClass('checked'); 
                   $(this).parents('.min-form').find('label.Wine').removeClass('checked'); 
                   $(this).parents('.min-form').find('label.Spirits').removeClass('checked'); 

                 }
                    else 
                 { 

                    $(this).parents('.min-form').find('label.Beer').addClass('checked');
                    $(this).parents('.min-form').find('label.Wine').addClass('checked');                   
                    $(this).parents('.min-form').find('label.Spirits').addClass('checked'); 
                 }                
                  return false; 
             });               

when I check alcoholic and its sub checkboxes get selected automatically.My problem is that when I submit the form which do not have any action the checkboxes get unchecked automatically.I don’t know how this happens ?? why checkboxes get unselected automatically when I submit form which dont have any action in form tag???

  • 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-15T13:29:58+00:00Added an answer on June 15, 2026 at 1:29 pm

    When you don’t have any actions in the form, it just reloads the page – hence the empty checkboxes.
    If you add

    return false;
    

    to your coding when the submit button is clicked, it will keep the form from submitting (to nothing) and so the page from refreshing.

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

Sidebar

Related Questions

I have a workbook that has many checkboxes (form control) on one tab. I
I have a application that in one form( Form1 ) I have many checkBoxes
I have a form that has many checkboxes (too many for it to make
I need to make the program which have one form that contains PNG image
I have one windows form file that each time I open it in Visual
I have five buttons on one form that when clicked enables a bool each
I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to
This is probably a basic html/css question... I have a simple one-button form that
I've creating one ASP web application, in that application one form have to update
I have a form that collects information, one piece of which is a phone

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.