Laravel form field mask

0

Good evening, all right?

I can not find a way to include a validation mask with Laravel's Form Collective. Here's the snippet of code with a field:

 {{Form::label('comp_nota','Competência')}}
{{Form::text('comp_nota','',['class'=>'form-control','required','placeholder'=>'Ex: 08/2018'])}}

I need to enter the field by typing the field in the middle of the field. ex: 02/2018.

That is, the user only types 022018.

What can I use galley?

    
asked by anonymous 15.07.2018 / 02:17

2 answers

1

Solution :

One way to resolve this is to use the jquery.mask library for the masks of your fields.

Usage example :

jQuery(function ($) {
    $("#comp_nota").mask("99/9999");
});
    
18.07.2018 / 16:05
0

Problem

Create field with input type date with laravelcollective / html

Solution

{{Form::label('comp_nota','Competência')}}
{{Form::date('comp_nota','',['class'=>'form-control','required','placeholder'=>'Ex: 08/2018'])}}

Notes

Rate support for this attribute for different browsers link

    
15.07.2018 / 12:49