1

Does anyone know how to put a maximum value for a time input in Laravel Collective? I have tried this but it doesn't work:

{!!Form::time('tiempo[]', 'max="04:00"')!!}
Alessio
  • 3,404
  • 19
  • 35
  • 48
Lucas Tomic
  • 62
  • 2
  • 14

1 Answers1

1

Pass your options as the third parameter in an array. The second argument is the value of the input.

{!! Form::time('tiempo[]', null, ['max' => '04:00']) !!}
Dan
  • 5,140
  • 2
  • 15
  • 30
  • Thanks! And is there a way to the input only show hours until 4? – Lucas Tomic Jun 09 '20 at 12:31
  • Since every browser [works different](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#Appearance) on this approach, I can't really tell. Sorry. – Dan Jun 09 '20 at 12:35