Guest User

Untitled

a guest
Oct 17th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. HTML
  2.  
  3. <form id="my-form">
  4. <input type="email" id="my-text-input" />
  5. <input type="submit" />
  6. </form>
  7.  
  8.  
  9. Jquery
  10.  
  11. $('#my-form').on('submit', function(event) {
  12. event.preventDefault();
  13. if ( $('#my-text-input').val() == '' ) {
  14. alert('You did not enter.');
  15. } else if {
  16. alert('Thanks for filling the field!');
  17. }
  18. });
Add Comment
Please, Sign In to add comment