New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Form reset on elements with form attribute #4829
Conversation
@bluebill1049 may have a look please 😃 |
@ins0 Could you please explain more detail about the context of this pull request ? In what use case input element should be outside the form tag ? Following the HTML specs:
Referrer: https://www.w3.org/TR/html401/interact/forms.html#h-17.2.1 Meaning if the control element is not included in the form, its value should not be included when submitting form too. While react-hook-form is trying to follow default standard and semantic, it would be better to handle this specific case outside the library as an implementation inside your application. @bluebill1049 What do you think about this case ? |
Sorry for the late reply, was too busy resolving issues and roll out features. Personally, I prefer to skip this PR and the rationale is pretty much the same as what @leapful has stated. |
The main goal in using the https://www.w3.org/TR/html52/sec-forms.html#element-attrdef-formelements-form |
Thank you for your contributions! This Pull Request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Best, RHF Team ❤️ |
This is currently an issue for me. I would prefer you address this PR. We have a site-wide side sheet that gets pulled outside the |
I don't think the browsers are interpreting associated form elements as unsuccessful. Using the following form: <form id="id" method="post">
<input name="inside" type="text" value="inside" />
<button type="submit">Submit</button>
</form>
<input name="outside" type="text" value="outside" form="id" /> If I hit the submit button, the form data includes the value from both fields. It behaves consistently between Firefox, Chrome, and Safari. |
Thank you for your contributions! This Pull Request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Best, RHF Team ❤️ |
Thank you for your contributions! This Pull Request is being closed because it has not had any recent activity. Feel free to re-open the issue and begin work again! Best, RHF Team ❤️ |
This PR:
form
tagform
-Attributehttps://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#htmlattrdefform