IHYPRESS PROGRAMMING
Tutorials and JavaScript programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
JavaScript ❯ Form Validation 1
<13>
<html> <head> <script> function notEmpty(elem, helperMsg){ if(elem.value.length == 0){ alert(helperMsg); elem.focus(); return false; } return true;} </script> </head> <body> <form> Field #1: <input type="text" id="zone1" value="This field has text in it" /><br> Field #2: <input type="text" id="zone2" value="" /><br><br> <input type="button" onclick="notEmpty(document.getElementById('zone1'), 'sorry... empty field')" value="Check Field #1" /><br> <input type="button" onclick="notEmpty(document.getElementById('zone2'), 'sorry... empty field')" value="Check Field #2" /> </form> </body>
Hergestellt in Deutschland / Made in Germany
Field #1:
Field #2:


COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland