Untitled
unknown
plain_text
a year ago
444 B
9
Indexable
document.getElementById('oib').addEventListener('input', function (e) {
if (this.value.length > 11) {
this.value = this.value.slice(0, 11); // Trim to 11 characters
}
});
document.getElementById('oib-form').addEventListener('submit', function (e) {
const oib = document.getElementById('oib').value;
if (oib.length !== 11) {
alert('OIB must be exactly 11 characters long.');
e.preventDefault();
}
});Editor is loading...
Leave a Comment