var cf_code = {};
cf_code.check_required = function() {
  var errors = [];
  for (var i=0; i<rsv_custom_func_errors.length; i++) {
    if (rsv_custom_func_errors[i].func != "cf_code.check_required") {
      continue;
    }
    var field_name = rsv_custom_func_errors[i].field;
    var val = $.trim(window["code_mirror_" + field_name].getCode());
    if (!val) {
      var el = document.edit_submission_form[field_name];
      errors.push([el, rsv_custom_func_errors[i].err]);
    }
  }
  if (errors.length) {
    return errors;
  }
  return true;  
}