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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:05:09+00:00 2026-05-21T23:05:09+00:00

I have a form using an editor template showing a series of checkboxes pertaining

  • 0

I have a form using an editor template showing a series of checkboxes pertaining to a child list inside the form model. On form submit I need to check if all the checkboxes are checked for all child items and if not display a modal dialog to make sure that the user purposely decided to leave some of the checkboxes unchecked. I know that I can use the JQuery dialog to show the modal dialog, but I have no idea how to see if all the checkboxes in the editor templates are checked. My code is similar to the following:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Test.Models.ModelList>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  ShowPropReturn
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>ShowPropReturn</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm()) { %>
  <%: Html.ValidationSummary(true) %>
  <fieldset>
    <legend>ModelList</legend>

    <div class="editor-label">
        <%: Html.LabelFor(model => model.MyProperty1) %>
    </div>
    <div class="editor-field">
        <%: Html.EditorFor(model => model.MyProperty1) %>
        <%: Html.ValidationMessageFor(model => model.MyProperty1) %>
    </div>

    <div class="editor-label">
        <%: Html.LabelFor(model => model.MyProperty2) %>
    </div>
    <div class="editor-field">
        <%: Html.EditorFor(model => model.MyProperty2) %>
        <%: Html.ValidationMessageFor(model => model.MyProperty2) %>
    </div>

    <table>
        <%: Html.EditorFor(model => model.MyProperty3) %>
    </table>
    <p>
        <input type="submit" value="Save" />
    </p>
  </fieldset>
<% } %>

<div>
  <%: Html.ActionLink("Back to List", "Index") %>
</div>

</asp:Content>

and for the editor template:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Test.Models.ColumnList>" %>

<tr>
  <td>
    <%= Html.CheckBoxFor(x => x.value) %>
  </td>
</tr>

Any help would really be appreciated, 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-05-21T23:05:09+00:00Added an answer on May 21, 2026 at 11:05 pm

    add a class to your checkboxes like

    <%= Html.CheckBoxFor(x => x.value,new{@class="chk"}) %>
    

    and then hook in using jquery on submit event

    $("#form").live('submit', function(e){
          $(".chk").each(function(){
               if($(this).attr("checked") == false)
               {
                  //show modal dialogue here   
               }
           });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this this View for rendering form @using ExpertApplication.ViewModels @model IEnumerable<QuestionViewModel> @{ ViewBag.Title
I have form in my page, I am using ajax.beginform(). Inside this form I
I have a RadGrid control with template edit form implementation. I need to have
In my ASP MVC 3 application, I have this form @using (Html.BeginForm()) { <input
I have written a form using the jQuery .post() function to post the data
I have a Django form using textareas and TinyMCE for text entry. I would
I would like to have Ajax form in Rails so i'm using form_remote_tag. The
I created a form using Swing in Java. In the form I have used
i have seen people localize their form using resource. put text data in resource
I have a cancel button in a form: @using (Html.BeginForm(ConfirmBid,Auction)) { some stuff ...

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.