final-form / final-form-calculate

Decorator for calculating field values based on other field values in 🏁 Final Form
MIT License
113 stars 26 forks source link

field matching pattern #42

Closed BakriSusanto closed 4 years ago

BakriSusanto commented 4 years ago

Hi...everyone I don't understand about field matching pattern in final-form calculate. May be someone can help me. I have a case like picture below. and i want my form can calculate every time user input quantity and price/unit and the result display in total price. And in the last row can display total of the total price.

image

here is part of my code `

{({ fields }) => fields.map((item, index) => ( {index + 1} )) }
                <Table.Row>
                  <Table.Cell colSpan="5" textAlign="right">
                    <strong>TOTAL</strong>
                  </Table.Cell>
                  <Table.Cell colSpan="2" textAlign="right">
                    <Field
                      name="amountBeforeTax"
                      placeholder="Amount Before Tax"
                      value={purchase.amountBeforeTax}
                      component={NominalInput}
                    />
                  </Table.Cell>
                </Table.Row>

</Table.Body>`