= {
color="minimal"
StartIcon="user-plus"
className="my-2.5"
+ disabled={hasReachedLimit}
onClick={() => {
+ if (hasReachedLimit) {
+ return;
+ }
value.push("");
setValue(value);
}}>
{t("add_another")}
)}
+ {!readOnly && typeof maxEntries === "number" && maxEntries > 0 && (
+ {t("max_attendees_allowed", { count: maxEntries })}
+ )}
) : (
<>>
@@ -311,7 +322,11 @@ export const Components: Record = {
color="minimal"
variant="button"
StartIcon="user-plus"
+ disabled={hasReachedLimit}
onClick={() => {
+ if (hasReachedLimit) {
+ return;
+ }
value.push("");
setValue(value);
}}
diff --git a/packages/features/form-builder/FormBuilderField.tsx b/packages/features/form-builder/FormBuilderField.tsx
index 3288772d612f16..5c7035c15f8438 100644
--- a/packages/features/form-builder/FormBuilderField.tsx
+++ b/packages/features/form-builder/FormBuilderField.tsx
@@ -312,6 +312,7 @@ export const ComponentForField = ({
placeholder={field.placeholder}
name={field.name}
label={field.label}
+ maxEntries={field.maxEntries}
readOnly={readOnly}
value={value as string[]}
setValue={setValue as (arg: typeof value) => void}
diff --git a/packages/prisma/zod-utils.ts b/packages/prisma/zod-utils.ts
index 9dd03b80d581d3..d17bf8477a037a 100644
--- a/packages/prisma/zod-utils.ts
+++ b/packages/prisma/zod-utils.ts
@@ -1091,6 +1091,12 @@ export const baseFieldSchema = z.object({
*/
maxLength: z.number().optional(),
+ /**
+ * It is the maximum number of entries that can be provided for list fields.
+ * It is used for types like `multiemail`.
+ */
+ maxEntries: z.number().int().min(1).optional(),
+
// Emails that needs to be excluded
excludeEmails: excludeOrRequireEmailSchema.optional(),
// Emails that need to be required