I know that default HubSpot scripts can validate email not only with regex, free services domain check but also can determine if email phisically exist. If I insert email 'firstname.lastname@example.org' into email field I get error: "Please enter a valid email address.". How to achieve this functionality with custom JS implementation?
I'm not sure exactly how you would implement this on your end, but the following developer doc has some details on what HubSpot does to validate email addresses:
The only other checks we do that aren't explicitly mentioned in that article are to run an MX lookup for the email's domain, and run some additional proprietary email validation. HubSpot doesn't share the specific details of those checks, so you'd need to find other resources if you were looking to implement similar validation.
However, onFormSubmit doesn't look like it's triggered early enough to validate the email address.
More information: https://developers.hubspot.com/docs/methods/forms/advanced_form_options