...

View Full Version : javascript function(checkbox)



tanhaha_how
12-08-2006, 04:08 PM
hi all,currently i'm using check box to delete my records.it is nothing wrong when i delete one or more records.but,now the problem is when it is only left last record,no matter i check or uncheck the checkbox,it is still prompt put the same msg,which is"You need to choose at least 1 value!".......but i have checked the checkbox oledi......
can anyone hlpe me????


function checking(){
check=0;
choose = document.form.choice.length;
for (u=0; u < choose; u++) {
if(document.form.choice[u].checked == 1)
check= check+1;
}
if(check>0 && check !=0){

var where_to= confirm("Are you sure you want to delete your selection(s)?");
if (where_to== true)
{
var id = "";
a=0;
count = document.form.choice.length;

if(!count){
id = id + document.form.choice.value + ":";
a= a+1;
}

for (i=0; i < count; i++) {
if(document.form.choice[i].checked == 1){
id = id + document.form.choice[i].value + ":";
a= a+1;
}
}
form.a.value = a;

form.data1.value = id;

form.submit();
}
}else{
alert("You need to choose at least 1 value!");
}

}



thank u very much:o



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum