Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rank Input Validation to Only Accept Natural Numbers #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sandeshlavshetty
Copy link

@sandeshlavshetty sandeshlavshetty commented Oct 22, 2024

Solves issue #42

Description:
This pull request addresses the issue where the rank field in the form was accepting negative values, which should not be allowed since only natural numbers (positive integers) are valid inputs for rank.

Changes Made:

  1. Added input validation to ensure that the rank field only accepts positive integers.
  2. Implemented error handling to show an error message when the user enters an invalid rank (non-positive value).
  3. Disabled the submit button if the rank is invalid or any required field is empty.
  4. Updated the form to display an error message if the entered rank does not meet the validation criteria.

Steps to Re-create the Issue:

  1. Navigate to the form and select an exam from the dropdown.
  2. Enter a negative number or zero in the "Enter Category Rank" field.
  3. Observe that the form accepts the input without showing any error message or restricting submission.

This fix ensures proper validation, preventing submission when the rank is not a natural number.

Copy link
Contributor

@suryabulusu suryabulusu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. please take a pull of recent changes before merging. i'll merge #39 first and then yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants