- <script type="text/javascript">
- function checkForm()
- {
- var f=document.testform;
- if (!f.field0.value)
- {
- alert("Не заполнено обязательное поле");
- return false;
- }
- return true;
- }
- </script>
- <form name="testform" action="script.php" method="POST" onSubmit="return checkForm()">
- <input type="text" name="field0">
- <input type="submit" value="Go">
- </form>