#Validation errors not showing when using Inertia.post
1 messages · Page 1 of 1 (latest)
@rancid plume Please only post once, first warning :p
I don't remember in newer versions of Inertia handle images with FormData
Ok I'll try _method: 'post,
not working I really have to use _method: put
offical docs
the problem really is that validation when updating is not showing in view
WHEN using Inertia.post _method: put
My bad, kinda desparate since I've been trying to fix this for hours.
Well, when asking for help, you gotta be patient. And asking multiple times in the same server won't get you answers faster (might actually have the opposite effect)
I'll keep that in mind
But yeah, this has nothing to do with method spoofing. You're using two entirely different approaches, Inertia.post() and form.put(). The first one won't have any effect on the form object, so errors etc won't be updated.
You should use form.post() and add the method spoofing as the form data
Like this?
No
const form = useForm({
_method: 'put',
name: '',
});
form.post('url', options)
Or you'd have to use transform to add the field before submitting
is useForm() only available for vue3? I'm using vue2
No, not yet. But it's the same as creating a form with this.$inertia.form. Though, it's limited to options api
Ok so here's what I did so far. Validation error is still not displaying in view