CMS Development

hannahkhalil
Participant

Issues with customizing error message on form embed code

Hello!

 

Using a hbspot form which requires the user to input and submit an email.

I'm trying to change the error message when a user tried to submit an incomplete/invalid email. I've been using the guide on How to customize the form embed code on Hubspot, following this format: 

 

hbspt.forms.create({

         portalId: '',

         formId: '',

         locale: 'en',

         translations: {

                en: {

                       blockedEmail: "Please enter a valid email address",
                       }
              }
    });

The customizations for the error messages are not registering when the user clicks the submit button. For example, the error message still reads "Please change your email address to continue" (which is the default) instead of "Please enter a valid email address" (as shown in the my code above). However, the customized error message for keys like "invalidEmailFormat" works - and is displayed while the user is typing in the email field.

 

Basically, the customizations don't work on keys that are called after the submit button is clicked.

 

Would appreciate any suggestions!

0 Upvotes
2 Replies 2
Adesignl
Top Contributor | Partner
Top Contributor | Partner

Issues with customizing error message on form embed code

You seem to be missing the blocked domains:

blockedDomains : ['example.com', 'hotmail.com', 'gmail.com']

 

sharonlicari
Community Manager
Community Manager

Issues with customizing error message on form embed code

Hey @hannahkhalil        

 

I will tag a few of our experts to learn from them. 

 

Hey @Adesignl @Jsum @DanielSanchez  could you please share your knowledge with @hannahkhalil?    

 

Thank you

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes