Closed mfrancaleal closed 5 years ago
Consegui.
Consegui.
Consegui também usar a biblioteca jQuery-Mask-Plugin no Laravel, compartilho a minha solução.
<!doctype html>
<head>
</head>
<!-- resources/views/layouts/app.blade.php -->
<body>
<div id="app">
@yield('content')
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.js"
integrity="sha256-yE5LLp5HSQ/z+hJeCqkz9hdjNkk1jaiGG0tDCraumnA=" crossorigin="anonymous"></script>
<!-- Carrega o Script Personalizado na Página aqui -->
@yield("script")
</body>
</html>
Formulário Cadastrar
<!-- resources/views/user/create.blade.php -->
@extends('layouts.app')
@section('script')
<script>
$(document).ready(function($){
$('#cpf').mask('999.999.999-99');
});
</script>
@endsection
@section('content')
<form class="form-group" action="{{ action('UserController@store', 0) }}" method="post">
@csrf
<div class="col-md-2">
<label>CPF</label><br>
<input class="form-control" id="cpf" type="text" name="cpf" required><br>
</div>
</form>
@stop
Estou com dificuldades de integrar a biblioteca com o Laravel, precisamente na utilização no FORM.
Grato.
Have you take a look into our docs?
https://igorescobar.github.io/jQuery-Mask-Plugin/
Make sure your read this before opening a new issue:
https://github.com/igorescobar/jQuery-Mask-Plugin#problems-or-questions
Device
[...]
Browser (and version)?
[...]
Functional
jsfiddle
exemplifying your problem:You can use this one as exemple: http://jsfiddle.net/igorescobar/6pco4om7/
Describe de problem depth:
[...]
Is this plugin helping you out? Buy me a beer and cheers! :beer:
:bowtie: https://www.paypal.me/igorcescobar