Validate on suffixAction
I've got a form that is mostly visual, and only a couple of editing points, and doesn't have a general submit.
I thought I could be clever where I wanted a field to be editable in that view, by having a suffix Action acting as a save button for that field.
Works fine, but there is no validation run. Is there a command I can have within the action to run the field validation prior to the save?
Cheers
3 Replies
use
validateOnly
Thanks for this. I tried this, but it didn't work initially. I thought it may be something to do with the form being in a modal, and sure enough the prefix on the
wire:model
is not 'data'.
So: $livewire->validateOnly('mountedTableActionsData.0.rf_referee_telephone');
works...but can I rely on that always targetting the right element?ahh ok, you are using an action. Use this