Closed viganzeqiri closed 2 months ago
I think if you set the values before submission it would work, but not as clean as it could be, eg:
onClick={() => {
setValue(intent);
handleSubmit();
}}
I think if you set the values before submission it would work, but not as clean as it could be, eg:
onClick={() => { setValue(intent); handleSubmit(); }}
Thanks a lot for your answer :) I will give this a try, but yeah I was hoping for something cleaner 😅
The unfortunate thing is that the submission is kind of "controlled" via teh handleSubmit so theres no way to pass values in an uncontrolled manner
Hey there :) I have a form that could be submitted by two buttons, one button saves the data in server, and the other one saves and also changes the status. I send an intent inside submitData to determine which action to run, the save one has a
save
intent, while the other hassaveAndMoveToPending
. I wanted to know if its possible to pass the intent to the handleSubmit function based on the button I am clicking and not in the form config