Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML
- <form id="my-form">
- <input type="email" id="my-text-input" />
- <input type="submit" />
- </form>
- Jquery
- $('#my-form').on('submit', function(event) {
- event.preventDefault();
- if ( $('#my-text-input').val() == '' ) {
- alert('You did not enter.');
- } else if {
- alert('Thanks for filling the field!');
- }
- });
Add Comment
Please, Sign In to add comment