Mask using flask does not load

0

This is the header:

<script src="{{ url_for('static', filename='jquery-2.1.4.min.js') }}"></script>
<script src="{{ url_for('static', filename='main.js') }}"></script></script>

This is the field code that I want to put the CPF mask (000,000,000-00):

         <div class="col-sm-4">
            <strong>{{ perfilForm.CPF.label }}</strong>  
            {{ perfilForm.CPF(class_="form-control", value=meuPerfil.CPF) }}
          </div>

Inside main.js I have this structure:

$(document).ready( function () {
    $('#CPF').mask('000.000.000-00');
} );

However it does not enter the moment that I type the numbers. Can anyone give me the hint?

    
asked by anonymous 09.10.2018 / 17:55

1 answer

0

You're using jQuery Mask that is not part of jQuery and therefore needs to be loaded also. By the way, is that "_=" correct? This example using pure HTML worked:

09.10.2018 / 19:35