Count Items Selected in List

[Total: 0    Average: 0/5]

This will count the number of items selected in a form select list.

Body Code:

function doIt()
  var _x=0;
  var _F=document.exf1.s1.options;
  for(var i=0;i<_F.length;i++)
<form name=exf1>
<select name=s1 size=5 multiple>
    <option value=0>Zero</option>
    <option value=1>One</option>
    <option value=2>Two</option>
    <option value=3>Three</option>
    <option value=4>Four</option>
    <option value=5>Five</option>
    <option value=6>Six</option>
    <option value=7>Seven</option>
    <option value=8>Eight</option>
    <option value=9>Nine</option>
<input type=button name=b1 value="Count Them" onclick=doIt()>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *