evanwht / phoos-java

Phoosball webserver implemented in java and react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game Form Validation

evanwht opened this issue · comments

The game form should run validation before sending to the web server. According to the current rules the validation rules are:

  • there should be 4 unique players
  • half time scores should not exceed 5 points
  • winning scores should be between 10 and 15,
  • winning scores should be at least 2 more than the losing except when the winning score is 15.

This should be done in a way that allows for new sets of rules to be applied easily. Other rule sets could include 2 player games, games that don't have 2 different halves, and games that end at scores other than 10.

An alert should display with steps to fix the issues when the form fails validation. There could also be something visual that draws the users attention to the invalid fields. Options include highlighting or outlining in red or helpful tool tip with a failure reason.