validate text field with mask in laravel

-3

I want to validate some fields of a form, by axis: the text field that has the following mask: 000-0000000-0

    
asked by Gali 14.03.2017 в 05:16
source

2 answers

0

You can use jQuery-Mask-Plugin and do something like

$(function() {
    $("#id_campo").mask('000-0000000-0', {reverse: true});
}

Here you can see how to work with JQuery in laravel.

    
answered by 14.03.2017 в 09:06
0

Hello, how easy is it to occupy a pattern in the input in this way?

I put it that way why I imagine you want numbers between 0 and 9.

<input type="text"  pattern="^[0-9]{3}[\-][0-9]{7}[\-][0-9]{1}" title="000-0000000-0">

Of wanting only numbers 0 would be like this:

<input type="text"  pattern="^[0]{3}[\-][0]{7}[\-][0]{1}" title="000-0000000-0">

Greetings, tell me how it went!

    
answered by 14.03.2017 в 22:44