Is it possible to exclude Gmail addresses from completing contact forms?

Question: I have a client who only wants to accept form submissions from company email addresses. Is this possible? TIA.
[Clearly ask your question.]

Product:
[Which editor or feature is your question most relevant to? e.g. Wix Editor, Wix Studio Editor, Editor X.]

What are you trying to achieve:
[Explain the details of what you are trying to achieve. The more details you provide, the easier it is to understand what you need.]

What have you already tried:
[Share resources, forum topics, articles, or tutorials you’ve already used to try and answer your question.]

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

Hi Jerry

Yes this is indeed possible with Wix Velo, so you’ll need a little coding experience.

You can use this Code:

// Import Wix Window for Lightbox
import wixWindow from 'wix-window';

// Eventhandler for your Email Input field
export function inputField_onChange(event) {
    // Check if field includes "@gmail.com"
    if (event.target.value.includes("@gmail.com")) {
        // Clear input field, if includes @gmail.com
        $w("#inputField").value = "";

        // Handle Error (in this case open a Lightbox. You could also show an Error Text on your Site.
        wixWindow.openLightbox("Error");
    }
}

Hope that solves it :slight_smile:

Thank you very much!