Gurus,
I have a value prompt and would like to count the number of items selected by the user after leaving the field.
What I have done is created and HTML Item before the list with this code:
<div id = "Select" onblur= (CountItems)>
After the list I have two HTML Items
</div>
and
Function CountItems()
{
var i=0;
var numSelected = 0;
for (i=0; i<Select.length; i++)
{
if(Select.selected)
{
numSelected = numSelected + 1;
}
}
return numSelected;
alert(numSelected);
}
</script>
The alert is just for testing. This approach is not working. I am not savy with using the HTML Items I may not be making sense in setting them up.
Can anyone help me out??
The end result is that if a user selects more than 1 items I want to display something if not keep it hidden. Once I get the count can I populate something for the variable to use?
Any help would be much appreciated.
Wouldn't it be a bit easier to just fetch the item as well and perform a count distinct within the report?