HTML: <form id="Forma1" name="Forma1" method="post" action="" onsubmit="checkForm(this);return false;"> <script> function checkForm(form) { for (var i = 0; i < form.elements.length; i++) if (form.elements[i].value == '') { alert ('Заполните все поля'); return false; } form.action = 'log.php'; form.submit(); } </script> <input type="text" name="id" /> <input type="text" name="e-mail" /> <input type="image" src="button.png" name="submit"> </center> </form> Только смысла в таком мало, все равно редирект на log.php произойдет. Я бы вообще AJAX'ом отправлял, без отправки самой формы.