You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see I'm using jQuery to submit the form and if both assigning the value and submitting the form happen in the same function, empty data is submitted. I can work around this by using a timeout with no delay, but of course that's not ideal.
This also happens when it's not in the mounted method, but for instance on blur out, so it has nothing to do with page load or delays. Same goes for :value versus v-model.
I don't know much of the internals of Vue or JS, but I presume it's because it hasn't been able to assign the values yet. Using a timeout, the submit occurs on the next tick.
The text was updated successfully, but these errors were encountered:
Has this issue been posted before then? Couldn't find anything.
Well, in my case, I just want to submit the form automatically including the page refresh, don't want to (and can't) send it via Ajax. If there's no solution, perhaps a mention in the docs would be nice to have?
Say I have a simple component with nothing but a
mounted
method that does the following:My component html looks like this:
As you can see I'm using jQuery to submit the form and if both assigning the value and submitting the form happen in the same function, empty data is submitted. I can work around this by using a timeout with no delay, but of course that's not ideal.
This also happens when it's not in the mounted method, but for instance
on blur out
, so it has nothing to do with page load or delays. Same goes for:value
versusv-model
.I don't know much of the internals of Vue or JS, but I presume it's because it hasn't been able to assign the values yet. Using a timeout, the submit occurs on the next tick.
The text was updated successfully, but these errors were encountered: