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

AwadGorg's avatar

Set custom value to html input type date

Hello, I am making update form and I want to update a row in my db the update also except date I am trying to set the date value that already exists in my db row to the HTML input date but for some reason it's not working this is how I am trying to set the date

<input class="form-control" type="date" name="initial_release"
                            vlaue="{{  date('Y-m-d', strtotime($game->initial_release)) }}">

this function

{{  date('Y-m-d', strtotime($game->initial_release)) }}

return 2019-09-26

but HTML input is empty nothing shown in it and when I update the row it reset the date to null

0 likes
3 replies
MichalOravec's avatar
Level 75
value="{{ date('Y-m-d', strtotime($game->initial_release)) }}"

It has to be value and not vlaue.

1 like
tykus's avatar

Typo on the attribute name

vlaue
1 like
AwadGorg's avatar

No no no, i spent like an hour hour on this and it was an html error 🤒🤕😭😭😭😭😭

Please or to participate in this conversation.