diff --git a/js/rezervacija.js b/js/rezervacija.js index 80c7a82..baf5de7 100644 --- a/js/rezervacija.js +++ b/js/rezervacija.js @@ -42,9 +42,9 @@ function preveriEmail() { function preveriTelefon (){ const vrednost = telefon.value.trim(); - const vzorec = /^0\d{2} ?\d{3} ?\d{3}$/; //https://www.w3schools.com/js/js_regexp.asp + const vzorec = /^0\d{2} ?\d{3} ?\d{3}$/; //https://www.w3schools.com/js/js_regexp.asp, spet ^pomeni zacetek besedila, obvezno 0, \d{2} za ničko obvezno dve stevili (d- digit), ?- neobvezen presledek, \d{3} 3 stevila, $ zakljucek besedila if (!vzorec.test(vrednost)) { - napakaTelefon.textContent = "Vnesite veljavno telefonski številko."; + napakaTelefon.textContent = "Vnesite veljavno telefonsko številko."; telefon.classList.add("napacno"); return false; } diff --git a/rezervacija.html b/rezervacija.html index 973265e..c1cd4ce 100644 --- a/rezervacija.html +++ b/rezervacija.html @@ -52,8 +52,11 @@