Closed abakumov-v closed 6 years ago
According to MDN, the default type
attribute of button
is submit
, so that's why if you use <button className="btn btn-primary">Submit</button>
, it will raise the submit
event and trigger the handleSubmit
. So I assume your other buttons are all have type='button'
, because you don't want to submit the form when your user click add copy or remove current block button or add new empty block button right? Hope this will explain the issue :)
@andyhu92 thanks for your explanation! I didn't really know that the default value of button type
attribute is submit
.
Hi!
I have parent component
IncomeOperationItem
:It looks like this: I'm not understand how can I submit form inside my block? On each block I have 2 buttons:
When I click on my any button
ValidationForm
does not throwhandleSubmit
event. But if I add instead of my "remove button" this code:and it's looks like this:
the
ValidationForm
raisehandleSubmit
event! How? :)