﻿function validateDropDownList(source, arguments) {
    arguments.IsValid = false;
    if (arguments.Value != "0") {
        arguments.IsValid = true;
    }
}

function validateEmptyTextDropDownList(source, arguments) {
    arguments.IsValid = false;
    if (arguments.Value.length > 1) {
        arguments.IsValid = true;
    }
}

function validateEmptyTextDropDownListByValue(source, arguments) {
    arguments.IsValid = false;
    if (arguments.Value.length > 0 && arguments.Value != "0") {
        arguments.IsValid = true;
    }
}

function validateCheckBoxList(id) {
    var success = false;
    var checkboxes = document.getElementById(id).childNodes;

    if (checkboxes != null && checkboxes.length > 0) {
        for (i = 0; i < checkboxes.length; i++) {
            if (checkboxes[i].type == "checkbox") {
                if (checkboxes[i].checked) {
                    success = true;
                }
            }
        }        
    }
    return success;
}
