<script> $(document).ready(function () { $("#form1").validate({ onsubmit: false, validClass: "has-success" }); $('.validationGroup .causesValidation').click(Validate); }); function Validate(evt) { var $group = $(this).parents('.validationGroup'); var isValid = true; $group.find(':input').each(function (i, item) { if (!$(item).valid()) { $(this).closest('.validationGroup').addClass('has-error'); isValid = false; } }); if (!isValid) evt.preventDefault(); } </script>
<div class="btn-group" data-toggle="buttons"> <label class="btn btn-default active"> <input type="radio" value="M" />Male </label> <label class="btn btn-default"> <input type="radio" value="F" />Female </label> </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)