Using alpine to update a Form Field using an x-on event listener.
I feel like I'm missing something simple. If I have two form fields and want to use alpine to update another field 'on change', how can I do this? I want the interaction to be instant, without the roundtrip form the server (or at least to happen at the same time so it feels instant).
Clearly I cannot x-model here as it doesn't work or I'm setting the value incorrectly.
The event is firing properly, I can see my console logs fill properly:
I think it is just where I'm trying to set the value is incorrect and where I need some pointers please. π
selectedId = $event.detail.newId;
1 Reply
Argh, I was targeting a div and not the select....