From: Carl Worth Date: Sun, 3 May 2020 17:54:57 +0000 (-0700) Subject: Use an actual "submit" input element instead of a "button" X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;ds=sidebyside;h=fd874838b0063b8f565cfd007fe4e9cc456e0db7;hp=5cad55ac63756da77fda3d9fc2ead1c8789fd9de;p=empires-html Use an actual "submit" input element instead of a "button" This has the advantage of allowing the user to just press the Enter key on any field of the form in order to submit it. For this we move the invocation of our javascript handler for the form submission from onclick() of the button to onsubmit() of the form itself. Finally, we have to reutnr false from our new onsubmit() handler so that the browser doesn't reload the page (which would clear the message that results from a new player being added). --- diff --git a/index.html b/index.html index 2e539e7..7b44445 100644 --- a/index.html +++ b/index.html @@ -26,14 +26,15 @@
-
+ + - +