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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:44:43+00:00 2026-06-14T02:44:43+00:00

I am using ASP.net for a program with a number of check boxes and

  • 0

I am using ASP.net for a program with a number of check boxes and a submit button which initiates an action depending on the selected check boxes.

However, one of my check boxes should behave as this submit button, i.e, upon selecting/deselecting this check box, the same action as the button must be triggered. Can someone please help me in doing this (or perhaps direct me to a tutorial)

I have a controller class and model.

Thanks you

EDIT
The program look like:

@using(Html.BeginForm("controllername", FormMethod.Get)) {
     @html.CheckBox("check1");
     @HTMl.Checkbos("check2");
     <input type="submit" value="Submit" />
}

Everything else is pretty much handled in the controller.

  • 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-14T02:44:44+00:00Added an answer on June 14, 2026 at 2:44 am

    You can use javascript to listen to the check event of your check box and then invoke the form submit.

    Assuming your markup of view is like this

    <form id="yourFormId" action="user/post">
      <input type="checkbox" class="optionChk" value="1" /> One
      <input type="checkbox" class="optionChk" value="2" /> Two
      <input type="checkbox" class="optionChk" value="3" /> Three
    </form>
    <script type="text/javascript">
      $(function(){
        $(".optionChk").click(function(){
          var item=$(this);
          if(item.val()=="2")   //check your condition here
          {
             item.closest("form").submit();
          }
        });
      });
    </script>
    

    EDIT : As per the question edit.

    Change the CheckBox Helper method usage like the below to add a css class to the checkbox so that we can use that for the jQuery selection.

     @Html.CheckBox("check1",new { @class="optionChk"})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using RequiredFieldValidator in my asp.net program. I have a sign out button
Using C# ASP.NET I want to program a queue. I want to have X
I'm creating a program using C# (in ASP.NET environment) that makes an XML file.
Using ASP.NET 3.5 and jQuery UI. When a user clicks the Search button, a
I'm learning to program using C# and ASP.NET with a SQL Server database. I
I am using SQL Server 2008 in a asp.net/c# program. I am trying to
I'm considering using SQL Compact 4 for my ASP.NET Web Application, the program will
A customer using a ASP.NET program I have just sent them is experiencing the
Recently i start develop a setup program using asp.net , I want to save
I'm using asp.net mvc. Everytime I run/compile the program it creates membership and role

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.