Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateForm(){
- var form=document.getElementById('liquorreport');
- var nameField = form.getElementsByName('declarename')[0];
- return nameField.value.match(/\S/) ? true : false;
- if(!nameField.value.match(/\S/)){
- alert('You forgot to fill out your name!!!');
- return false;
- }
- }
- <form id="liquorreport" action="liquorreport.php" method="post" onsubmit="return validateForm()">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement