Replace the text in each text field below with the correct JavaScript object, property, method, function name or comment. Click the test your code! button and see your JavaScript code in action.

 
<html>
<head>

<title>JavaScript pull-down menu example</title>
<script language = "JavaScript">
function 1 (form) {
if (2 == "") {

    alert("You can't get away without entering something!"); }
for (i=0; i<form.textField.value.length; i++) {
    if (3 < "0") {
      alert("You're entering letters you little rascal you!"); break;
    }
    if (form.textField.value.charAt(i) > "9") {
      alert("You're entering letters you little rascal you!"); break; }
    }
}
</script>
</head><body>

Enter your zip code:

    <form 4 =
    "return 5 (this)"
    >
      <input type=text name=textField
      size=30 maxlength=40>
      <input type=submit value=submit>
    </form>
</body>
</html>
 




Ask questions & get answers at the JavaScript forum >>

Back to example index

©2000 Joe Sriver, www.sriver.com