Skip to content

fix(form): detect Marketo .mktoInvalid as a validation failure (FORMS-16836)#578

Open
05rahulsingh wants to merge 1 commit into
adobe:mainfrom
05rahulsingh:fix/forms-16836-minimal
Open

fix(form): detect Marketo .mktoInvalid as a validation failure (FORMS-16836)#578
05rahulsingh wants to merge 1 commit into
adobe:mainfrom
05rahulsingh:fix/forms-16836-minimal

Conversation

@05rahulsingh

@05rahulsingh 05rahulsingh commented May 29, 2026

Copy link
Copy Markdown

Adds `.mktoInvalid` to the invalid-field selector so Marketo forms are caught by the existing validation check.

```diff

  • const invalidFields = form.querySelectorAll(':invalid');
  • const invalidFields = form.querySelectorAll(':invalid, .mktoInvalid');
    ```

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:

URL Before After
twilio.com/en-us/help/sales formsubmit fires no formsubmit
surest.com/contact-us formsubmit fires no formsubmit

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant