<script type="text/javascript"> function notEmpty(){ var MyTextField = document.getElementById('myText'); alert(MyTextField.value) } </script> <input type='text' id='myText' /> <input type='button' onclick='notEmpty()' value='Form Checker' />