Home > Web Front-end > JS Tutorial > Determine whether checkboxlist (.net control client ID) is selected in js_javascript skills

Determine whether checkboxlist (.net control client ID) is selected in js_javascript skills

WBOY
Release: 2016-05-16 17:37:35
Original
1161 people have browsed it

When submitting content to be added or modified, the key data needs to be checked. How to determine whether the checkboxlist has options in js?
The specific operation is as follows:

Copy the code The code is as follows:

var CheckBox = document. getElementById("<%=cblWeek.ClientID %>").getElementsByTagName("INPUT");
if (CheckBox != undefined) {
var i = 0;
var j = 0;
for (i = 0; i < CheckBox.length; i ) {
if (CheckBox[i].checked) {
j = 1;
}
}
if (j == 0) {
alert("Please select a day of the week!");
return false;
}
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template