Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

earmsby's avatar

input with datalist

In my laravel project, I have a form with an input that uses a datalist to select the value. Right now it works ok with a bit of javascript to add the id of the selected name to a hidden field. I'm doing something like this in the blade file:

And then I added a bit of javascript like this:

This works ok, but I wondered if there was another way to do this without the plain javascript. Maybe with LiveWire or some other Laravel feature I haven't discovered yet?

0 likes
4 replies
earmsby's avatar

@martinbean oh, that's weird. They were there when I first posted. Maybe they got stripped out for some reason. Anyway, I was able to follow LarryAI's example and that worked.

earmsby's avatar

The AI example also now seems to have disappeared. Even weirder...

Please or to participate in this conversation.