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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:15:15+00:00 2026-06-09T02:15:15+00:00

I have enabled the unobtrusive validation. My page source looks looks like this. <p>

  • 0

I have enabled the unobtrusive validation. My page source looks looks like this.

<p>
    <label>
        Project Title
        <br />
        <input class="project-title" data-val="true" data-val-required="The Project Title field is required."
            id="RequestDetail_ProjectTitle" name="RequestDetail.ProjectTitle" type="text"
            value="" />
    </label>
    <span class="field-validation-valid" data-valmsg-for="RequestDetail.ProjectTitle"
        data-valmsg-replace="true"></span> </p> <p>
    <span>Submitted By</span><br />
    <span class="inline-container">
        <input type="hidden" id="RequestDetail_SubmittedBy" name="RequestDetail.SubmittedBy"
            value="0" data-type="RequestDetail.SubmittedBy" /><label><input type="radio" data-type="RequestDetail.SubmittedBy"
                name="_RequestDetail.SubmittedBy" value="1" data-val="true" data-val-required="The Submitted By field is required." />ND</label>
        |
        <label>
            <input type="radio" data-type="RequestDetail.SubmittedBy" name="_RequestDetail.SubmittedBy"
                value="2" data-val="true" data-val-required="The Submitted By field is required." />NE</label>
        |
        <label>
            <input type="radio" data-type="RequestDetail.SubmittedBy" name="_RequestDetail.SubmittedBy"
                value="4" data-val="true" data-val-required="The Submitted By field is required." />WY</label>
        |
        <label>
            <input type="radio" data-type="RequestDetail.SubmittedBy" name="_RequestDetail.SubmittedBy"
                value="8" data-val="true" data-val-required="The Submitted By field is required." />CL</label>
    </span><span class="field-validation-valid" data-valmsg-for="_RequestDetail.SubmittedBy"
        data-valmsg-replace="true"></span> </p> <p>
    <span>Affected Plans</span><br />
    <span class="inline-container">
        <input type="hidden" id="RequestDetail_AffectedPlans" name="RequestDetail.AffectedPlans"
            value="0" data-type="RequestDetail.AffectedPlans" /><label><input type="checkbox"
                data-type="RequestDetail.AffectedPlans" name="_RequestDetail.AffectedPlans" value="1"
                data-val="true" data-val-required="The Affected Plans field is required." />ND</label>
        |
        <label>
            <input type="checkbox" data-type="RequestDetail.AffectedPlans" name="_RequestDetail.AffectedPlans"
                value="2" data-val="true" data-val-required="The Affected Plans field is required." />NE</label>
        |
        <label>
            <input type="checkbox" data-type="RequestDetail.AffectedPlans" name="_RequestDetail.AffectedPlans"
                value="4" data-val="true" data-val-required="The Affected Plans field is required." />WY</label>
    </span><span class="field-validation-valid" data-valmsg-for="_RequestDetail.AffectedPlans"
        data-valmsg-replace="true"></span> </p>

Here is the output of it when validated.

enter image description here

I have applied everything the same way with Radio buttons and the Check boxes shown in this. But why am I not getting the validation error in the Check boxes, while I get what I expected in Radio buttons.

  • 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-09T02:15:17+00:00Added an answer on June 9, 2026 at 2:15 am

    If you think about it, the checkboxes will pass validation whether they are ticked or not. They will (presumably) be backed by a bool property in your model, and so must be either true or false. Ticked they are true, unticked they are false – which is a perfectly valid value for a bool. The only invalid value in this case would be null which is not possible with a checkbox.

    If your goal is to validate that the user has ticked the box, you will need a MustBeTrue validator – see here for an example.

    If true and false are both valid values, and you want to force a user to pick one or the other, use a drop-down with “Yes”, “No”, and “Please specify” as options.

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

Sidebar

Related Questions

I have enabled second level and query caches in my app Looks like when
I have a simple class library project (with Class1 ) and have enabled NuGet
I have enabled unobtrusive client side validation in my app, and I have (something
I have enabled google Minify in code igniter using this library on our website.
I have enabled mod_rewrite in my Xampp Apache. When I run my phpinfo() page,
I have enabled .NET network tracing per this article here: http://msdn.microsoft.com/en-us/library/ty48b824.aspx Unfortunately, the log
I have the following code in MVC 3.0 with unobtrusive JavaScript enabled. using (Ajax.BeginForm(search,
I have enabled the inbuilt logging within Codeigniter. This works fine. However I'm running
I have a form and unobtrusive validations are enabled. By default in submit method
I have enabled sfDoctrineGuardPlugin, so I have change myUser class to my class extends

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.