Skip to content

Conversation

@SahilMotiramani
Copy link

Fixes #34944

Problem

When a form contains <input name="id">, the named control clobbers form.id,
causing React to associate the temporary submitter with the input instead of the form.
This results in the submitter's name/value missing from FormData.

Fix

Use form.getAttribute('id') instead of form.id inside
createFormDataWithSubmitter() to always retrieve the form’s actual id attribute.

Tests

Added regression tests in:

  • packages/react-dom-bindings/src/events/__tests__/form-action-submitters.test.js

Covers:

  • Internal submit button
  • External submit button using form="my-form"

All lints and tests pass locally.

… createFormDataWithSubmitter; add regression tests
@meta-cla
Copy link

meta-cla bot commented Oct 27, 2025

Hi @SahilMotiramani!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@SahilMotiramani
Copy link
Author

Hi! I’ve signed the Meta CLA and verified my change locally.
The fix addresses issue #34944 by using the form’s id attribute instead of the named control form.id.
Please let me know if any further changes are needed. 😊

@meta-cla meta-cla bot added the CLA Signed label Oct 27, 2025
@SahilMotiramani
Copy link
Author

Hi @jackpope 👋,
I’ve implemented the fix for issue #34944 — the missing form submitter when a form includes an .
The change replaces the clobbered form.id property with a safe form.getAttribute('id') lookup and adds regression tests for both internal and external submit buttons.

All checks are green and the Meta CLA has been signed ✅.

Could you please review this PR when you get a chance and merge if it looks good? Thanks! 🙏

@SahilMotiramani
Copy link
Author

Hi @poteto 👋,
I’ve implemented the fix for issue #34944 — the missing form submitter when a form includes an .
The change replaces the clobbered form.id property with a safe form.getAttribute('id') lookup and adds regression tests for both internal and external submit buttons.

All checks are green and the Meta CLA has been signed ✅.

Could you please review this PR when you get a chance and merge if it looks good? Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Form submitter is missing, if form includes input with name 'id'

1 participant