Skip to main content
Solved

Technical/Descriptive: “Validate Klaviyo Form Emails to Allow Only Work Domains (Block Gmail, Yahoo, etc.)

  • October 27, 2025
  • 2 replies
  • 45 views

Forum|alt.badge.img

I have a Klaviyo form embedded on my WordPress website using the following code:

<div class="klaviyo-form-xxxxx"></div>


What I want is for the form to accept only work (business) email addresses in the email field. If someone enters a personal email address (like Gmail, Yahoo, Outlook, etc.), the form should display an error message and prevent submission.

 

Best answer by whereisjad

@mamun_990 you can add client side validation to the form that can occur when users try to submit the form:
 

function validateEmail() {
const email = document.getElementById('email').value;
if (email.includes("@gmail.com")) {
alert("Gmail addresses are not allowed.");
return false;
}
// You can add other validation checks here
return true;
}

2 replies

whereisjad
Expert Problem Solver IV
Forum|alt.badge.img+16
  • Expert Problem Solver IV
  • Answer
  • October 27, 2025

@mamun_990 you can add client side validation to the form that can occur when users try to submit the form:
 

function validateEmail() {
const email = document.getElementById('email').value;
if (email.includes("@gmail.com")) {
alert("Gmail addresses are not allowed.");
return false;
}
// You can add other validation checks here
return true;
}

Forum|alt.badge.img
  • Author
  • Contributor I
  • October 27, 2025

Thank You brother, It’s working now.