Guest User

Untitled

a guest
Oct 17th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. function validateEmail()
  4. {
  5. var validemail = document.forms["feedback"]["email"].value;
  6. if (/(.+)@(.+).(.+)/.test(validemail)){
  7. return true;
  8. }
  9. else {
  10. alert('Invalid email or email not filled out')
  11. return false;
  12. }
  13. } // validateEmail
  14.  
  15. </script>
  16.  
  17. <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  18. <script>
  19. function agecheck() {
  20. if($('input[name=age]:checked').length<=0)
  21. {
  22. alert("Please select your age");
  23. return false;
  24. }
  25. } // agecheck
  26.  
  27. </script>
  28.  
  29. <form name = feedback onsubmit=" validateEmail() && validatename() && agecheck() ">
Add Comment
Please, Sign In to add comment