APIs & Integrations

nmartin
Member

Required field error message customization / functionality

Is there a way to provide a custom error message in the vicinity of the submit button when a required field(s) is not properly filled out?? Envisioned it saying something like: “please complete all mandatory fields”. Currently error message is only at field not properly filled out. Problematic for long forms.
or
If field(s) is not filled out properly, is there functionality to automatically scroll to said problem field?

Thanks for your help!

0 Upvotes
3 Replies 3
dan_hmonks
Member

Required field error message customization / functionality

Hello, we can build custom field validation and with custom error message, we need to take help of javascript or jquery to achieve same. fields which require custom error message can be made hidden, and we can insert input fields using jquery and pass their value to hidden fields, we can validate and give custom message, to these using any jquery validation library

Let us know if you need any help with a demo.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Required field error message customization / functionality

Hi @nmartin

We do have some options for customizing forms, including customizing the error messages, but there isn’t a way to add an extra error message to the submit button, or scroll the page when there’s an error.

You can find all of the details for customizing forms using the embed code here:

How to customize the form embed code

This is a list of options that you can use if you just need to tweak a default hubspot form. If you need complete control over the styles and actions of your form, you will still want to use the Forms API.

0 Upvotes
Johnny1
Member

Required field error message customization / functionality

hi @dadams

I would like to change required field error message as well. Is there another easy way to change “Please complete this mandatory field” error message?

The link you provided is complicated for me. I just want to write for phone number field “please provide your phone number”, for email field “please write your email address” etc.

Thank you for your answer in advance.

0 Upvotes