-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added server-side validation for game setup form
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div> | ||
<form id="setup-form" action="/setup" method="POST"> | ||
|
||
<div class="form-section"> | ||
Player 1, select your mark: | ||
<input type="radio" name="player_mark" value="X" />X | ||
<input type="radio" name="player_mark" value="O" />O | ||
</div> | ||
|
||
<% if params[:player_mark] == nil %> | ||
<p>*Please select a mark in order to continue.</p> | ||
<% end %> | ||
|
||
<div class="form-section"> | ||
Would you like to play against the computer?: | ||
<input type="radio" name="opponent" value="yes" />Yes | ||
<input type="radio" name="opponent" value="no" />No | ||
</div> | ||
|
||
<% if params[:opponent] == nil %> | ||
<p>*Please indicate if you would like to play against the computer in order to continue.</p> | ||
<% end %> | ||
|
||
<div class="form-section"> | ||
<input id="setup-submit" type ="submit" value="Submit" /> | ||
</div> | ||
</form> | ||
</div> | ||
|