I'm doing a project in MVC and with the use of jQuery I made the CPF mask as below:
$(document).ready(function()
{
$(".cpf").mask("999.999.999-99");
$(".cpf").addClass("form-control");
});
Follow my div
:
<div class="form-group">
@Html.LabelFor(model => model.Cliente_CPF, htmlAttributes: new { @class = "control-label" })
<div>
@Html.EditorFor(model => model.Cliente_CPF, new { htmlAttributes = new { @class = "cpf" } })
@Html.ValidationMessageFor(model => model.Cliente_CPF, "", new { @class = "text-danger" })
</div>
</div>
The mask is working properly, however I need this information to be written to my DB without the mask! Only CPF numbers.
How should I do it?