urejen html za datum, pripravljen za urejanje v js
This commit is contained in:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user