]> git.cworth.org Git - lmno.games/commit - empires/index.html
Use an actual "submit" input element instead of a "button"
authorCarl Worth <cworth@cworth.org>
Sun, 3 May 2020 17:54:57 +0000 (10:54 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 3 May 2020 17:54:57 +0000 (10:54 -0700)
commit2e2acdff91c575a648a31134a81e7aef065c35ab
tree01b305eedb0f022541b4aae15c72f874b029a2d9
parent439615da796cbec332f3a7bb19431df182cc290e
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).
empires/index.html