availity-reactstrap-validation icon indicating copy to clipboard operation
availity-reactstrap-validation copied to clipboard

Trigger form action in onValidSubmit

Open arnaud-deprez opened this issue 6 years ago • 0 comments

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:

  1. call preventDefault in onInvalidSubmit
  2. 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,

arnaud-deprez avatar Jan 03 '19 12:01 arnaud-deprez