0

I'm creating a formular in html so as to integrate it in a cloud page on marketing cloud. I ask for an email address. I want to allow email address with a "." in the domain, for example : [email protected]

My code for the moment :

<div class="srf-field_wrapper">
                    <label for="emailAddress">E-mail*</label>
                    <input id="emailAddress" name="emailAddress" required="" type="text" placeholder="Ex: [email protected]*" pattern="[a-zA-Z0-9\.]+@[a-zA-Z0-9]+\.[a-z]+" oninvalid="setCustomValidity('Veuillez remplir ce champ obligatoire')" oninput="setCustomValidity('')">
                </div>

Does someone know how to adapt my code so as to allow this kind of emails ?

1 Answer 1

1

You need to update your regex to allow for that extra 'dot' in the domain, like this:

[a-zA-Z0-9\.]+@[a-zA-Z0-9\.]+\.[a-z]+

You can check how this behaves in my regex example here: https://regex101.com/r/EqJzPg/1

1
  • thank you a lot
    – ayakuza91
    Commented May 30, 2023 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .