diff --git a/src/components/client/donation-flow/steps/payment-method/PaymentDetailsStripeForm.tsx b/src/components/client/donation-flow/steps/payment-method/PaymentDetailsStripeForm.tsx index c7364f2f7..6e68dbd1e 100644 --- a/src/components/client/donation-flow/steps/payment-method/PaymentDetailsStripeForm.tsx +++ b/src/components/client/donation-flow/steps/payment-method/PaymentDetailsStripeForm.tsx @@ -79,6 +79,12 @@ export default function PaymentDetailsStripeForm({ id="billingName" variant="outlined" placeholder={t('donation-flow:step.payment-method.field.card-data.name-label')} + onInput={(e) => { + const input = e.target as HTMLInputElement + input.value = input.value + .replace(/[^a-zA-Z\s-]/g, '') + .replace(/[-\s]{2,}/g, (match) => match[0]) + }} />