javascript:
function validateRegionlist(source, args) {
var chkListRegions = document.getElementById('<%= cblRegion.ClientID %>');
var chkListinputs = chkListRegions.getElementsByTagName("input");
for (var i = 0; i < chkListinputs.length; i++) {
if (chkListinputs[i].checked) {
args.IsValid = true;
return;
}
}
args.IsValid = false;
}
________________________________________________________________________________
Html
<div id="dProductID" style="width: 210px; height: 70px; overflow: scroll; background-color: White;
color: Black">
<asp:CheckBoxList ID="cblProductID" runat="server">
</asp:CheckBoxList>
</div>
_________________________________________________________________________________
Validator
<asp:CustomValidator runat="server" ID="cvRegion" ClientValidationFunction="validateRegionlist"
ErrorMessage="Please select Region" ValidationGroup="CreateITSol"></asp:CustomValidator>
function validateRegionlist(source, args) {
var chkListRegions = document.getElementById('<%= cblRegion.ClientID %>');
var chkListinputs = chkListRegions.getElementsByTagName("input");
for (var i = 0; i < chkListinputs.length; i++) {
if (chkListinputs[i].checked) {
args.IsValid = true;
return;
}
}
args.IsValid = false;
}
________________________________________________________________________________
Html
<div id="dProductID" style="width: 210px; height: 70px; overflow: scroll; background-color: White;
color: Black">
<asp:CheckBoxList ID="cblProductID" runat="server">
</asp:CheckBoxList>
</div>
_________________________________________________________________________________
Validator
<asp:CustomValidator runat="server" ID="cvRegion" ClientValidationFunction="validateRegionlist"
ErrorMessage="Please select Region" ValidationGroup="CreateITSol"></asp:CustomValidator>
No comments:
Post a Comment