and step form
how to access form.item values which are in stepform in antd formprops.onFinish
8 Replies
underlying-yellow•2y ago
its working properly using form , but not able to get using steps form
<Form
form={form}
{...formProps}
onFinish={(values: any) => {
formProps?.onFinish &&
formProps?.onFinish({
...values,
tax_percent: value,
});
}}>
this way is not working in steps
sensitive-blue•2y ago
Hey @rehan1, checking the issue now
@rehan1, can you provide a repro in stackblitz or somewhere else? What's the exact issue here, is
values
undefined or lacking some properties?underlying-yellow•2y ago
the stckblitz link in the documentation of antd steps is also not getting open so that i can let u know the issue
https://stackblitz.com/edit/refinedev-refine-ezwfvx?preset=node
this is the link in documentation
@alicanerdurmaz i need to modify form.item values before sending <Steps {...stepsProps}>
<Steps.Step title="First Step" />
<Steps.Step title="Second Step" />
</Steps>
<Form
{...step}
layout="vertical"
onFinish={values => {
console.log(values, "safsjdfvsjdhvkjdshvkj");
}}>
{formList[current]}
</Form>
in Normal form its working in steps am not a
Hey @rehan1 ,
You can check this issue
https://github.com/refinedev/refine/issues/1594
GitHub
[BUG] onFinish doesn't work when used in a stepsForm · Issue #1594 ...
Describe the bug When I have a steps Form and I need to use onFinish to modify the payload before sending the API, this doesn't happen. The form does not modify the payload. To Reproduce St...
underlying-yellow•2y ago
it worked
can i modify the values like for example am able to add new but nnot able to remove from it .. before sending i want to remove a value from it
You can do whatever you want with the method I suggested in the issue.
underlying-yellow•2y ago
<Button
{...saveButtonProps}
onClick={() => {
const values = form1.getFieldsValue(true);
console.log(values, ",mnasskfjnskdzv");
submit({
title: "test,test,test",
});
}}>
Submit
</Button>
HERE I AM not SENDING VALUES but in payload values are being sent
object
:
{name: "TEST", base_rate: "5", department_id: "b9934b58-b851-45bd-b234-6641be636d56",…}
base_rate
:
"5"
department_id
:
"b9934b58-b851-45bd-b234-6641be636d56"
name
:
"TEST"
title
:
"test,test,test"
Might be related to Ant Design