-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Submit form from outside #13
Comments
Now I use Portal https://gist.github.com/romanlex/bf61fb0c3db2ef1a6c68cb07a0904da2 but I think need remote submit method ( |
Wow, look at you using Can you not pass |
if I remove handleSubmit my button doesnt work because buttons render to another domNode with Ract.createPortal <CallbackForm
buttonPortalId={containerActionId}
subscription={{ submitting: true, pristine: true }}
/>
<footer
className="divider-block__footer-actions"
id={containerActionId}>
// my buttons
</footer> |
It's not very React-y, but I wonder if you could use the DOM itself to achieve this, by calling <form id="myForm" onSubmit={handleSubmit}> ... </form>
...
<button type="button" onClick={() => document.getElementById('myForm').submit()}>
Submit
</button> |
@romanlex it seems we ran into similar problems. For me, calling Maybe you can even chime in and tell me why the heck the things i did actually worked, when |
Hello! Why I use Portal but not use <button
className="btn btn-outline-secondary btn-block"
type="button"
onClick={reset}
disabled={submitting || pristine}>
Reset form
</button>
<button
className="btn btn-primary btn-block"
type="submit"
onClick={handleSubmit}
disabled={submitting}>
Submit
</button> |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello. How I can submit form from outside sibling component? Example I want submit form by button from modal window
The text was updated successfully, but these errors were encountered: