Limit checkbox's list selection options
Last Post 02-13-2012 03:19 AM by Nectarios Tsolakis. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages Not Resolved
Nectarios TsolakisUser is Offline
Posts:4
Avatar

--
02-12-2012 11:07 AM
    Hello all,

    we have a checkbox list with ten options, but we want our users to be able to choose only up to three options.
    Could anyone please provide us with the Javascript snippet for this?

    Many thanks,

    Nectarios
    Nectarios TsolakisUser is Offline
    Posts:4
    Avatar

    --
    02-13-2012 03:19 AM
    This is the function we have so far but when we calling from the client site as countChecked($(outCheckboxlist)) it returns a null on the first alert and undefined on the second. Any ideas?

    function countChecked(CheckBoxList)
    {
         var objChkBoxLst = document.getElementById(CheckBoxList)
          alert(objChkBoxLst);
             if(objChkBoxLst)
             {
                var objChkBoxes = objChkBoxLst.getElementsByTagName('input');
                var i; var numSum = 0;           
                   for(i=0;i               {                   
                     if(objChkBoxes.checked)
                     {                   
                       numSum += 1;
                         
                     }
                   }
            }
                
    document.getElementById('SelNote').innerHTML = numSum;
    alert(numSum);
    return numSum;
    }



    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi