2
Look at the picture;
You can see from the image that the field is accepting more than ten digits, what I need to do is allow the user to only type ten digits in the data field, I’m having difficulty correcting the bug due to lack of experience.
The html component is this below;
<div class="form-group col-4">
<label>Período</label>
<div class="row" style="margin: 0">
<input type="date" class="form-control col-5" name="dataInicial" [(ngModel)]="filtro.dataInicial" InputDateValidationOnBlur/>
<span class="col-2" style="text-align: center; padding-top: 5px">até</span>
<input type="date" class="form-control col-5" name="dataFinal" [(ngModel)]="filtro.dataFinal" InputDateValidationOnBlur/>
</div>
</div>
Please I need a lot of help, I found this link below, I do not know it helps clear so they can help me.
https://stackblitz.com/edit/angular-triyfr?file=src%2Fapp%2Fapp.component.html
tried to put
maxlength=10
? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input or in angular form:ng-maxlength="10"
?– Ricardo Pontual
I have tried, maxlength does not support date field.
– wladyband
I really need to try to validate the number of digits with date type.
– wladyband
Eae, blz? The Date field already has the format, min and max I don’t understand the need to validate the length and the mask of the input already takes care of it.
– Ulric Merguiço