availity-reactstrap-validation
availity-reactstrap-validation copied to clipboard
Trigger form action in onValidSubmit
Hi,
First many thanks for your project, it helps me a lot to bootstrap quickly a form and have validation around.
I'm building a Gatsby static website and I'm trying to use a formspree contact form in it.
formspree works simply by letting the browser performing a form post action
on https://formspree.io/[email protected].
I looked into the code https://github.com/Availity/availity-reactstrap-validation/blob/master/src/AvForm.js#L84-L91 and I see the AvForm is always preventing the event to be handle by the agent (with preventDefault
).
In my case, I would need to either:
- call
preventDefault
in onInvalidSubmit - manually trigger a post form in
onValidSubmit
From what I see in the code, option 1 is not currently doable.
And I don't know how to use option 2 because even if ref, I would point to the AvForm
react object and not the html form
.
As you see, I'm not an expert in frontend development as I come from the backend world :-). So any help is appreciate !
Cheers,