@ht-ftw Do you have a typo? It should be wire:model (colon), not wire.model (dot).
Feb 2, 2024
7
Level 1
validation numeric - not working?
Hi, I've got the following validation rule in my component:
#[Validate('required', message: 'Enter price.')]
#[Validate('numeric', message: 'The value must be numeric.')]
public $price;
and an input field in the blade file:
<input type="number" wire:model="price">
the validation works fine however when I type in a text (e.g. "dowdy") it is displaying "required" error so the message is "Enter Price" instead of "numeric" message. If I remove the:
type="number"
from my input field the validation works fine and displays correct error if the input value is not numeric. What am I doing wrong? Or should it be like that? Thanks I'm on Laravel 10 and Livewire 3.4.4 HT
Please or to participate in this conversation.