Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel form inputs - how to set maxlength

Maximal length of HTML inputs can be set by: <input type="text" name="" maxlength="10"> Is there a way how to set maxlength of form input when creating inputs in Laravel way?

{{ Form::text('name', null, array('placeholder' => '')) }}
like image 596
Tomas Turan Avatar asked Dec 17 '14 12:12

Tomas Turan


2 Answers

{{ Form::text('name', null, array('placeholder' => '','maxlength' => 10 )) }}

Works with the Chrome Version 39.0.2171.95 (64-bit)

like image 200
Joe Avatar answered Oct 02 '22 03:10

Joe


You can also check in validation as follow. For more details, you can take a look in validation

$validator = Validator::make(
    array('name' => 'name'),
    array('name' => 'required|max:5')
);
like image 39
Naing Lin Aung Avatar answered Oct 02 '22 03:10

Naing Lin Aung