Displaying it first, (before the form for joining an existing game).
Also drop the submit button from the join form, (relying on the user
simply entering a game ID instead).
This makes the primary flow smoother: Choose a game, then click "Host"
without the user being confronted with a form and having to decide
which of two buttons to click.
<div id="message-area">
</div>
+ <form onsubmit="lmno_new('anagrams'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
<form onsubmit="lmno_join(this); return false">
<div class="form-field large">
- <label for="id">Game ID</label>
+ <label for="id">Or join an existing game:</label>
<input type="text" id="id" maxlength="4"
placeholder="Enter a 4-letter Game Code"
oninput="this.value = this.value.toUpperCase()"
autocomplete="off"
- required
- autofocus>
- </div>
-
- <div class="form-field large">
- <button type="submit">
- Join Game
- </button>
+ required>
</div>
-
- </form>
-
- <form onsubmit="lmno_new('anagrams'); return false;">
- <button type="submit">
- Host a new game
- </button>
</form>
</div>
<div id="message-area">
</div>
+ <form onsubmit="lmno_new('empathy'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
<form onsubmit="lmno_join(this); return false">
<div class="form-field large">
- <label for="id">Game ID</label>
+ <label for="id">Or join an existing game:</label>
<input type="text" id="id" maxlength="4"
placeholder="Enter a 4-letter Game Code"
oninput="this.value = this.value.toUpperCase()"
autocomplete="off"
- required
- autofocus>
- </div>
-
- <div class="form-field large">
- <button type="submit">
- Join Game
- </button>
+ required>
</div>
-
- </form>
-
- <form onsubmit="lmno_new('empathy'); return false;">
- <button type="submit">
- Host a new game
- </button>
</form>
</div>
<div id="message-area">
</div>
+ <form onsubmit="lmno_new('empires'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
<form onsubmit="lmno_join(this); return false">
<div class="form-field large">
- <label for="id">Game ID</label>
+ <label for="id">Or join an existing game:</label>
<input type="text" id="id" maxlength="4"
placeholder="Enter a 4-letter Game Code"
oninput="this.value = this.value.toUpperCase()"
autocomplete="off"
- required
- autofocus>
- </div>
-
- <div class="form-field large">
- <button type="submit">
- Join Game
- </button>
+ required>
</div>
-
- </form>
-
- <form onsubmit="lmno_new('empires'); return false;">
- <button type="submit">
- Host a new game
- </button>
</form>
<h2>What is Empires?</h2>
<div id="message-area">
</div>
+ <form onsubmit="lmno_new('letterrip'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
<form onsubmit="lmno_join(this); return false">
<div class="form-field large">
- <label for="id">Game ID</label>
+ <label for="id">Or join an existing game:</label>
<input type="text" id="id" maxlength="4"
placeholder="Enter a 4-letter Game Code"
oninput="this.value = this.value.toUpperCase()"
autocomplete="off"
- required
- autofocus>
- </div>
-
- <div class="form-field large">
- <button type="submit">
- Join Game
- </button>
+ required>
</div>
-
- </form>
-
- <form onsubmit="lmno_new('letterrip'); return false;">
- <button type="submit">
- Host a new game
- </button>
</form>
</div>
<div id="message-area">
</div>
+ <form onsubmit="lmno_new('scribe'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
<form onsubmit="lmno_join(this); return false">
<div class="form-field large">
- <label for="id">Game ID</label>
+ <label for="id">Or join an existing game:</label>
<input type="text" id="id" maxlength="4"
placeholder="Enter a 4-letter Game Code"
oninput="this.value = this.value.toUpperCase()"
autocomplete="off"
- required
- autofocus>
- </div>
-
- <div class="form-field large">
- <button type="submit">
- Join Game
- </button>
+ required>
</div>
-
- </form>
-
- <form onsubmit="lmno_new('scribe'); return false;">
- <button type="submit">
- Host a new game
- </button>
</form>
</div>
<div id="message-area">
</div>
+ <form onsubmit="lmno_new('tictactoe'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
<form onsubmit="lmno_join(this); return false">
<div class="form-field large">
- <label for="id">Game ID</label>
+ <label for="id">Or join an existing game:</label>
<input type="text" id="id" maxlength="4"
placeholder="Enter a 4-letter Game Code"
oninput="this.value = this.value.toUpperCase()"
autocomplete="off"
- required
- autofocus>
- </div>
-
- <div class="form-field large">
- <button type="submit">
- Join Game
- </button>
+ required>
</div>
-
- </form>
-
- <form onsubmit="lmno_new('tictactoe'); return false;">
- <button type="submit">
- Host a new game
- </button>
</form>
</div>