mirror of
https://github.com/tabler/tabler.git
synced 2026-07-28 22:14:39 +04:00
20 lines
629 B
HTML
20 lines
629 B
HTML
<input type="text" name="input-{{ include.name | default: 'mask' }}" class="form-control" data-mask="{{ include.mask | default: '00/00/0000' }}"{% if include.visible %} data-mask-visible="true"{% endif %}{% if include.placeholder %} placeholder="{{ include.placeholder }}"{% endif %} autocomplete="off"/>
|
|
|
|
{% append_lib imask %}
|
|
{% capture_once scripts %}
|
|
<script>
|
|
(function () {
|
|
const $elem = $('[data-mask]');
|
|
|
|
if ($elem) {
|
|
$elem.each(function () {
|
|
IMask($(this).get(0), {
|
|
mask: $(this).attr('data-mask'),
|
|
lazy: $(this).attr('data-mask-visible') === 'true',
|
|
});
|
|
});
|
|
}
|
|
})();
|
|
</script>
|
|
{% endcapture_once %}
|