fix(form): detect Marketo .mktoInvalid as a validation failure (FORMS-16836)#578
Open
05rahulsingh wants to merge 1 commit into
Open
fix(form): detect Marketo .mktoInvalid as a validation failure (FORMS-16836)#57805rahulsingh wants to merge 1 commit into
05rahulsingh wants to merge 1 commit into
Conversation
Marketo Forms 2.0 (used by Twilio and Surest contact forms) sets .mktoInvalid on fields that fail validation. Since these forms use novalidate, :invalid is always empty, causing formsubmit to fire even when validation failed. Adding .mktoInvalid to the existing selector closes the false-positive for Marketo-rendered forms. Fixes FORMS-16836 (Twilio, Surest). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds `.mktoInvalid` to the invalid-field selector so Marketo forms are caught by the existing validation check.
```diff
```
Marketo Forms 2.0 set `novalidate` on the form element, so `:invalid` is always empty even when the user leaves required fields blank. Marketo instead marks invalid fields with `.mktoInvalid`. Without this fix, `formsubmit` fires on failed submissions, inflating conversion counts.
Validated on production: