var cf_phone = {};
cf_phone.check_required = function() {
  var errors = [];
  for (var i=0; i<rsv_custom_func_errors.length; i++) {
    if (rsv_custom_func_errors[i].func != "cf_phone.check_required") {
      continue;
    }
    var field_name = rsv_custom_func_errors[i].field;
    var fields = $("input[name^=\"" + field_name + "_\"]");
    fields.each(function() {
      if (!this.name.match(/_(\d+)$/)) {
        return;
      }
      var req_len = $(this).attr("maxlength");
      var actual_len = this.value.length;
      if (req_len != actual_len || this.value.match(/\D/)) {
        var el = document.edit_submission_form[field_name];
        errors.push([el, rsv_custom_func_errors[i].err]);
        return false;
      }
    });
  }

  if (errors.length) {
    return errors;
  }

  return true;
  
}