Availity / availity-reactstrap-validation

Easy to use React validation components compatible for reactstrap.
https://availity.github.io/availity-reactstrap-validation/
MIT License
191 stars 70 forks source link

How to use another button in the form #211

Closed LoanAubergeon closed 3 years ago

LoanAubergeon commented 3 years ago

I want to use another button (not submit button) to do a action in the form. When I click on the button, the form is submitted.. How to do that ?

TheSharpieOne commented 3 years ago

Give it a type of "button" (type="button"). If you are using reactstrap's Button, simply handling the click (via onClick function) will have reactstrap set the type to "button".

HTML default is submit. Check out: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button

LoanAubergeon commented 3 years ago

I did not give the type "button" to the reactstrap's Button.