using JQuery to CheckBoxList Require Valid

摘要:using JQuery to CheckBoxList Require Valid

將原本CustomerValidator JavaScript驗證改為JQuery的用法

 

            function CheckBoxListRequireValid(source, args) {
                var $chkListItems = $('#'+source.controltovalidate).find('input');
                var isValid = false;
                $chkListItems.each(function() {
                     var $chkItem = $(this);
                     if($chkItem.attr('checked')== true)
                          isValid = true;
                });
                args.IsValid = isValid;
            }