I work on asp.net mvc project .I need to checj radio button list have at least one option selected using jquery
so how to check if radio button one from options selected using jquery client side please
Python
@model HR.WorkforceRequisition.Models.ResignationRequester
@{
ViewBag.Title = "Requester Index";
Layout = "~/Views/Shared/_LayoutResignation.cshtml";
}
textarea {
width: 100% !important;
}
#searchContainer {
display: block;
position: relative
}
#searchContainerDirector {
display: block;
position: relative
}
.ui-autocomplete {
position: absolute;
}
@Html.AntiForgeryToken()
Employee Informed of Restrictions On :
*
@Html.RadioButtonFor(model => model.EmployeeRestrictions, "Solicitations of Customers")
Solicitations of Customers
@Html.RadioButtonFor(model => model.EmployeeRestrictions, "Customers Lists")
Customers Lists
@Html.RadioButtonFor(model => model.EmployeeRestrictions, "Confidentiality Obligations")
Confidentiality Obligations
@Html.RadioButtonFor(model => model.EmployeeRestrictions, "Removing Company Document")
Removing Company Document
@Html.RadioButtonFor(model => model.EmployeeRestrictions, "Restrictions on Solicitations of Employee")
Restrictions on Solicitations of Employee
@Html.RadioButtonFor(model => model.EmployeeRestrictions, "Others If Any")
Others If Any
$(document).ready(function () {
// validate radio button have value or not
});
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
so please how to check if group of radio button have at least one selected or checked using jquery

Amit MohantyRank #112 · 20K reputationPosted Sep 13, 2023, 2:01 AM EDT
$(document).ready(function () { $("#btnsubmit").click(function (e) { // Check if at least one radio button with the name "EmployeeRestrictions" is checked if ($("input[name='EmployeeRestrictions']:checked").length === 0) { alert("Please select at least one option from the list."); e.preventDefault(); // Prevent the form from submitting } }); });Rajeev KumarRank #1,334 · 1.3K reputationPosted Sep 13, 2023, 2:12 AM EDT
$('#myForm input').on('change', function() { alert($('input[name=EmployeeRestrictions]:checked', '#myForm').val()); });Mohammad HussainRank #513 · 4.8K reputationPosted Sep 14, 2023, 2:58 AM EDT
$(document).ready(function () { // Attach a click event handler to the submit button $("#btnsubmit").click(function (e) { // Check if at least one radio button is checked if ($('input[name="EmployeeRestrictions"]:checked').length === 0) { alert("Please select at least one option for Employee Informed of Restrictions."); e.preventDefault(); // Prevent form submission if no option is selected } }); });