Hi!
I have 2 forms on a page one is “invoice-rows” like invoice-rows.0.summa … invoice-rows.n.summa
I’m using wire:modell and HTML name with the same name with dots to build up the arra invoice-rows[0].summa. It works excellent.
I have other form calculator. It is workink simular way, excellent,
I have buttons on the calculator form. I would like to update some invoice-rows summa filed with the calculated SUM value from the calculator.
I could find the solution yet. I can update the fields well. The input filed value is update, but the invoice-row form don’t recognise this update, livewire is not sending the new value of the filed to the server.
I also tried to add wire:model on the button . not working.
I tried to send with JS change event on the filed: not working
var event = new Event(‘change’);
var element=document.getElementById(‘summa.{{ $index }}’);
document.dispatchEvent(event);
If the filed was updated with this JS code and I’m saving that form, the new (updated) value is not sent by the form, I’m saving the original value what was updated with JS.
But if go manually into this field and I do a manual updtae, like I’m deleting one char, the filed value will send to the server and it works fine with Livevire.
I could’nt find solution with Alpine.js
Do you have any idea?
Thanks
Gergely