checkboxlist
checkboxlist has 5 controls.
every end user is able to select 5 boxes but not less than one .asp.net
Status:
Open Oct 11, 2007 - 04:43 AM
asp.net 2
5answers
Answers
May 11, 2009 - 01:11 AM
<br> function MyCheck() {
<br> var mcheck = $get("<%=CheckBoxList1.clientId %>");
<br> var intI =0;
<br> var intcounter =0;
<br> for(intI =0; intI < 5; intI++){
<br> var checkList = document.getElementById("<%=CheckBoxList1.clientId%>" + '_'+ intI);
<br> if (checkList != null && checkList.checked == true) {
<br> intcounter = intcounter + 1;
<br> }
<br> }
<br> if (intcounter == 0) {
<br> alert("please at least one checkBox!");
<br> }
<br> else {
<br> alert("You have selected " + intcounter + "checkbox");
<br> }
<br> return false;
<br> }
<br>
<br>
I hope above lines of code will help you
May 12, 2009 - 07:44 AM
Rajat just focus on it then reapply ur condition....
<!--
<!-- Begin
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}
function UnCheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
// End -->
This is the HTML code to be kept inside the body tag.
Scripts for Web design and programming
ASP
PHP
JavaScript
HTML
MySQL
May 13, 2009 - 11:05 AM
Hi amman,
As far as your script concen it may be correct but if you read Bhanu's question he is asking for checkBoxList.
Hope you got it.
Thanks.
May 13, 2009 - 12:19 PM
ok u win Rajat ......... y u r gonna ready to fight wid me ok i surrender...happy baby..............
Jun 04, 2009 - 02:27 PM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment