function formvalidation() { for (i=0;i<3;i++) { box = document.kontakt.elements[i]; if (!box.value) { alert('Niste unijeli ništa u polje ' + '\"' + box.name + '\"' + '!'); box.focus() return false; } } document.kontakt.submit(); }