Question Not Bug
cengizilhan opened this issue · comments
Hi all,
Im using like that. I wanna try native html validator. But if i write: "53_-____"
minlenth is 9 but there is too much char return from the .value property. so its not works. Is there anyway for work it ?
<input minlength="9" pattern=".{9,}" title="Cannot be empty" required type="tel" class="form-control" id="Phone" name="Phone" data-inputmask="'mask': '999-9999999' " />
I guess only way is only number with regex. no mask ?
You have the default placeholder
set to underscore character which fills the string so it satisfies the minlength
requirement. To disable this, set the placeholder option to an empty string '' like this:
<input minlength="9" pattern=".{9,}" title="Cannot be empty" required type="tel" class="form-control" id="Phone" name="Phone" data-inputmask="'mask': '999-9999999', 'placeholder': ''" />
Remember than the native HTML validation will just set Element.validity.valid
to either true
or false
which is not so useful.
thank you! its works