mariusmucenicu / knowlift

A software that will keep you sharp between the ears.
https://knowlift.com/
GNU General Public License v3.0
0 stars 1 forks source link

Add form validation on the grade page #193

Closed mariusmucenicu closed 5 years ago

mariusmucenicu commented 5 years ago

At the moment if no input is selected the form will submit with no data resulting in a 500 from the server. This results in a custom error page associated to the 500 status.

A more elegant approach would be to have the submit button disabled by default, and enable it only when a radio button is selected. The behaviour for the random button stays the same although the code will be refactored and moved to its specific js page grade.js.

Do note that this can be bypassed easily as any client-side validation but the net will be the backend where they'll see the custom 500 page.