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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:54:54+00:00 2026-05-14T19:54:54+00:00

I am using c# for coding! Below is my html for checkbox and radion

  • 0

I am using c# for coding!

Below is my html for checkbox and radion button

  <input type="radio" style="float: left;" name="documents" id="Checkbox9" value="yes"
                        runat="server" />
                    <label style="width: 35px!important;" class="checkbox">
                        <%=GetResourceString("c_HSGStudent")%>
                    </label>
                    <input type="radio" style="float: left;" name="documents" id="Checkbox10" value="no"
                        runat="server" />
                    <label style="width: 25px!important;" class="checkbox">
                        <%=GetResourceString("c_HSGParent")%>
                    </label>
                    <input type="radio" style="float: left;" cheked name="documents" id="Radio1" value="yes"
                        runat="server" />
                    <label style="width: 35px!important;" class="checkbox">
                        <%=GetResourceString("c_HSGStudent")%>
                    </label>
                    <input type="radio" style="float: left;" name="documents" id="Radio2" value="no"
                        runat="server" />
                    <label style="width: 25px!important;" class="checkbox">
                        <%=GetResourceString("c_HSGParent")%>
                    </label>

You can see I have two checkboxes and two radio buttons, My problem is that on my submit button click I want to check whether user have checked at-least one checkbox or radio button. It will be good if we can have .NET solution like (customvalidator).

Please suggest!

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-14T19:54:54+00:00Added an answer on May 14, 2026 at 7:54 pm

    First, add a CustomValidator to your page…

    <asp:CustomValidator runat="server" ID="CheckBoxRequired" EnableClientScript="true" 
        OnServerValidate="CheckBoxRequired_ServerValidate" 
        OnClientValidate="CheckBoxRequired_ClientValidate">*</asp:CustomValidator> 
    

    You can then then validate them from a client side function with a simple jquery call…

    <script type="text/javascript>
    
    function CheckBoxRequired_ClientValidate(sender, e) 
    { 
        e.IsValid = $("input[name='documents']").is(':checked'); 
    } 
    
    </script>
    

    code-behind for server side validation…

    protected void CheckBoxRequired_ServerValidate(object sender, ServerValidateEventArgs e) 
    { 
        e.IsValid = Checkbox9.Checked || Checkbox10.Checked || Radio1.Checked || Radio2.Checked;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know, how to fetch class name from div instead of id
I'm coding a templating system that is supposed to support easily converting any old
I am having trouble settling down to a proper practice for UI JavaScript coding.
Hey, I am trying to get the class names dynamically for the script below.
I've recently started exploring using AJAX for a small project, and I've had reasonable
I want to build a webapplication with a Single Page Interface, using ASP.NET MVC.
Bear with me as I try to learn more about .htaccess redirect rules -
Java has some very good open source static analysis tools such as FindBugs ,
I have a client who has made a 'Visual Diary' of photographs that he

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.