Support the ongoing development of Laravel.io →
posted 1 year ago
Last updated 1 year ago.

2btechdev2 liked this thread

1

You defined the minimum value for the field to be 0. So it's never going to show you a negative number, remove min="0"

0

Thank You alen for this tip. I removed min="0" but it did not have any effect. I also removed the 'placeholder' and 'step' entries. Now I have: <input name="amount" type="number" value="{{ $invoice->left() }}" class="form-control" wire:model.lazy="values.{{ $invoice->id }}.amount">

The browser´s code inspector shows: <input name="amount" type="number" value="655.85" class="form-control" wire:model.lazy="values.5705.amount">

The page in the the browser shows an empty input. Somewhere Laravel/Livewire seem to block the value.

Regards

Wayne

0
Solution

wire:model=“someProperty” will bind the component property $someProperty to the value a the input field. So if $someProperty has no value, the input won’t either.

Does $values[5705][‘value’] have a value?

Maybe initialise $values in the component class?

2btechdev2 liked this reply

1
Solution selected by @wayne

Thank you alen,

that solved my problem

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Wayne wayne Joined 27 Jan 2023

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.