0
I am developing an application and I am going through a difficulty when it comes to using Ajax, along with a plugin inputMask. I have some masks configured, but when it comes to using it in Ajax requests, they don’t work and I don’t know which direction to go.
Function of inputMask:
$('.input-cpf').inputmask({"mask": "999.999.999-99", "placeholder":"_"});
My input:
<input name="cpf" type="text" class="form-control input-cpf">
Could anyone help me? Which direction I need to take?
The CPF field is running without the mask during form submition with AJAX?
– SylvioT
You can detail better what is not working?
– Victor Carnaval
First, is the input element already rendered in the DOM before you call inputMas? Another point this input is returning from AJAX as you may be loading inputMask into an element that is not yet in the DOM and when it is returned via AJAX the plugin function will not recognize the newly inserted element.
– Marcus Italo