Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript function(checkbox)

    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
    Last edited by tanhaha_how; 12-08-2006 at 05:43 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •