hello,
i have this javascript for checkbox list validation it works fine with checkboxlist that atleast one value should be selected
<script type="text/javascript">
function ValidateCheckBoxList1(sender, args) {
var checkBoxList = document.getElementById("<%=CheckBoxList2.ClientID %>");
var checkboxes = checkBoxList.getElementsByTagName("input");
var isValid = false;
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
isValid = true;
break;
}
}
args.IsValid = isValid;
}
</script>
ClientValidationFunction="ValidateCheckBoxList" ValidationGroup="pl" runat="server" CssClass="validation" />
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource2" DataTextField="Trucktype" DataValueField="Trucktype" RepeatDirection="Horizontal" RepeatColumns="3">
i want to apply same validation on checkboxlist inside the listview