-
-
Save cdaringe/de95112042b26fae80d761dc19ab38c5 to your computer and use it in GitHub Desktop.
Form Bugs // source http://jsbin.com/tebeqalaju
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://code.jquery.com/jquery-2.2.4.js"></script> | |
<title>Form Bugs</title> | |
</head> | |
<body> | |
<form id='wacky-form'> | |
<input type='text' /> | |
<button type='submit'>Submit</button> | |
<p id='message'><p> | |
</form> | |
<script id="jsbin-javascript"> | |
// Click "Run with JS" | |
// Observe the form load and disappear. | |
// - Add a comment explaining why this is happening | |
// - Add a fix in the handleSubmit function to | |
// keep the form on screen | |
$('#wacky-form').on('submit', function handleSubmit (evt) { | |
console.log('handling submit') | |
$('#message').text('SUCCESS') | |
}) | |
$('button').click() | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// Click "Run with JS" | |
// Observe the form load and disappear. | |
// - Add a comment explaining why this is happening | |
// - Add a fix in the handleSubmit function to | |
// keep the form on screen | |
$('#wacky-form').on('submit', function handleSubmit (evt) { | |
console.log('handling submit') | |
$('#message').text('SUCCESS') | |
}) | |
$('button').click()</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Click "Run with JS" | |
// Observe the form load and disappear. | |
// - Add a comment explaining why this is happening | |
// - Add a fix in the handleSubmit function to | |
// keep the form on screen | |
$('#wacky-form').on('submit', function handleSubmit (evt) { | |
console.log('handling submit') | |
$('#message').text('SUCCESS') | |
}) | |
$('button').click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment