form with multiple fields using the same model property
I have a single amount field on my model, and another field that indicates whether the amount is a credit or a debit. I need to display this data in a form and I'm having trouble creating 2 form fields based on the same model attribute.
I'm using this to get my form data (for the sake of this question, i'm leaving out the logic that differentiates between debits and credits):
And then I want to display them in these form fields:
I can dd the fillForm method and I get the expected data, but it's not populating in the form fields. The only way I can get any data to populate in the form fields is to name the field the same as my model, and then it just seems to disregard the
fillForm
method.1 Reply
I should mention that the other fields are populating in the form, just not the one I'm trying to use twice.
I've tried wrapping an extra array around it as well, but no joy: