function requires(policy, requiredfields) {
    var missing = [];
    if (condition(policy)) {
        for ( var i=0; i != requiredfields.length; i++ ) {
            var field=$("#field-" + requiredfields[i]).val();

            if (!field) {
                $("#field-" + requiredfields[i]).addClass("error");
                field_label = $("#properties label[for='field-"+requiredfields[i]+"']").html();
                field_label = field_label.substring(0, field_label.length-1);
                missing.push(field_label);
            } else {
                $("#field-" + requiredfields[i]).removeClass("error");
            }
        }

        if (missing.length != 0) {

            if (missing.length == 1) {
                prestring = missing[0] + " は必須項目です ";
                poststring = "この項目を入力してください.";
            }
            else {
                prestring = missing.join(", ") + " は必須項目です		";
                poststring = "これらの項目を入力してください.";
            }
            
            return prestring + ".\n" + poststring;
        }
    }

    return true;
}

