I am trying to set a custom error message on a form but so far unsuccessful.
I have created a HubSpot form, set as raw HTML, embedded it on page (using hbspt.forms.create()), and added custom field validators in JavaScript that are correctly being registered with a callback function and triggered. All this works.
When a specific validation is false, how do I set a custom error message?
The method setCustomValidity(“error message”) does not seem to work, nor does ‘textContent’.
Hi Martin, thanks for letting me know, however when I go there the first link is this one, and works fine. Could you double-check? This will be the option available at the moment.
About the second one and third one that are the same one, you are right, those are no longer in the Marketplace for that reason you see a broken page.
For example, I have a text input field, and there are 4 different validations it needs to pass. The error message that needs to be displayed is dependent on the specific validation.