SOLVED

Re: Is there a way to define my own field errors rather than use the defaults?

Go to solution
richpf
Level 1

Is there a way to define my own field errors rather than use the defaults?

Hi all

I'm using the JavaScript API to create a simple newsletter signup form. The form is shared across a global website which is  translated in 20+ languages. 

There is only one visible field which is the email field and the the submit button.

We already have translations which our CMS outputs onto a hidden DOM element on the page - so with Javascript my solution is to set the form labels and submit button values with the correct translated version. 

 

What i am struggling with is how to override the default email error which is displayed when a user enters the wrong format since this error is in English.

 

I am trying to avoid managing 20+ separate forms in Marketo since I have been able pass the country into this form so our marketing team know where a customer has signed up from.

 

Any help would be greately appreciated. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to define my own field errors rather than use the defaults?

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to define my own field errors rather than use the defaults?

Yes, simply use form#showErrorMessage.