Created
August 28, 2024 12:45
-
-
Save ewalk153/1a33328968b801629eb3695aac055f1c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<html> | |
<head> | |
<title>Home</title> | |
<script> | |
function checkStatus() { | |
var queryString = parseQueryString(); | |
if (queryString['name']) { | |
var result = document.getElementById('result'); | |
result.innerHTML = 'Form submitted'; | |
} | |
} | |
function parseQueryString() { | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
var queryString = {}; | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
queryString[pair[0]] = pair[1]; | |
} | |
return queryString; | |
} | |
</script> | |
</head> | |
<body onload="checkStatus()"> | |
<h1>This is an example for to show the behavior of hitting enter</h1> | |
<form> | |
<input type="text" name="name" placeholder="Name" required> | |
<input type="submit" value="Submit"> | |
</form> | |
<div id="result"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment