Trying to update a hidden input with a value from a SweetAlert modal, but encountering issues.
The following code isn't working as expected - the form submits, but the hidden field's value remains null.
HTML:
<input type="hidden" name="input" v-model="value">
JavaScript:
this.value = websiteId;
event.target.submit();
On the other hand, the code below seems to do the trick. However, it raises questions about the necessity of using Vue.js over plain JavaScript.
HTML:
<input type="hidden" class="input-value-web" name="input" value="0">
JavaScript:
document.querySelector('.input-value-web').value = websiteId;
event.target.submit();