-4
In the database, the CPF field is bigint and long in the model. I have two problems with this: 1) If Cpf starts with 0 or 00, it will not record this and then, to display on screen, I will have to use Algon as padleft(11) or similiar. 2) Since I have a cshtml that was generated based on the model, then I am not able to generate the mask in the field to type Cpf. The problem is that in the bank, I will have different field sizes, for when Cpf starts with 0 or 00 and so on, I know that this would not be the problem, thanks to padleft(11).
<div class="form-group">
@Html.LabelFor(model => model.cpf, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.cpf, new { htmlAttributes = new { @class = "form-control", @id = "cpf" } })
@Html.ValidationMessageFor(model => model.cpf, "", new { @class = "text-danger" })
</div>
</div>
With the above code, I’m not able to mask the field, for the reasons already presented. Someone suggests?
why didn’t it work, gave error? elements are found by selector?
– Ricardo Pontual
Error did not give, but the mask did not load.
– pnet
Just as a tip and with all the good intentions. Review your participation in pnet site. Strive to make the questions as clear as possible as soon as you open them. Always include the mistakes they make, what you tried in code, why it doesn’t work, what you think the solution might be, etc. Remember that in addition to your questions helping you, they should also help any reader who has a similar question. Taking this for example, you asked the question more or less like this "I have this code and it gives error, someone has idea of how to correct ?"
– Isac
(...) If you didn’t even say what you were wrong about or what you’re trying to do, how is anyone going to be able to help? This forces those who want to answer to have to make several comments until they can find out, or to respond with something that was not what you wanted.
– Isac
I made an issue and see that now I get something
– pnet