Closed pitsail closed 2 years ago
Let's say select field looks like this:
<select name="form_data.branches" OTHER_PROPERTIES multiple> <option value="1">Branch 1</option> <option value="2">Branch 2</option> <option value="3">Branch 3</option> </select>
When values are picked in a standard cliking way everything is fine, selected ones are passed on form submit. But when i use javascript like:
document.getElementById('form_data.branches').options[1].selected = true;
values are displayed as selected but they are not passed on submit.
What am i missing? BTW this problem concerns all form fields.
It's because all forms are Livewire forms. You don't set Livewire properties in Javascript that way.
Please read the Livewire documentation on JavaScript interactions.
Let's say select field looks like this:
When values are picked in a standard cliking way everything is fine, selected ones are passed on form submit. But when i use javascript like:
values are displayed as selected but they are not passed on submit.
What am i missing? BTW this problem concerns all form fields.