0đ
In âJSON Dayslotsâ, your v-bind:value
is set to item.slot
, so vue binds items.slot
to search
. As a result, {{ search.shortcode }}
in your search summary is trying to access item.slot.search
, which doesnât exist. Setting v-bind:value to just âitemâ should make your code work.
<select v-model="search">
<option disabled="disabled" value="">JSON Dayslots</option>
<option v-for="item in items" v-bind:value="item">
{{ item.shortcode }} {{ item.slot }}
</option>
</select>
As for your addEventListener, Iâm not sure why it stops working. In your source code, your form name is myform
, while the const âformâ is bound to âsubmit-to-google-sheetâ. Perhaps this is the problem? Although in this question, it seems to be set up correctly.
const form = document.forms['submit-to-google-sheet']
Both are working in this jsfiddle: https://jsfiddle.net/adampiziak/mrdva3kj/10/
(the listener just outputs âsubmittedâ to the console)