> JavaScript treat multiple checkboxes as an array, but a single 
> checkbox is not an array. A quick goggle didn't turn me a up 
> with an example but there should be plenty of examples out 
> there of checking for this with JS.
> 
> You can also take what I consider to be an easier way out, 
> using CF to push down a different script depending on how many 
> boxes you are going to have.

That's right! I didn't even notice the single checkbox part of this. If you
look at the length of the checkbox array and get undefined, you only have
one checkbox, so there's no need to bother with separate scripts. I think
this would work for you:

function checkForNoSelections() {
        var e = document.viewItems;
        if (!e.atccNum.length && e.attcNum.checked) {
                return true;
        }
        for (var i = 0; i < e.atccNum.length; i++) {
                if (e.attcNum[i].checked) {
                        return true;
                }
        }
        alert('You must select an item to display.');
        return false;
}

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212464
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to