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

Issues/prevent invalid input #1073

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ouchi-Ranim
Copy link

Description

This pull request addresses the issue of preventing invalid input ( such as numerical values in the first/last name fields and alphabetical in phone number ) for form fields in the Idurar application specifically in people when adding a new person.
I made a few changes to fix this issue that I opened 3 weeks ago #1039:
The change must be in the forms/dynamicForm/index.js where I defined restrictions under the rules and I used regular expression (regex) to fix the issue, now it only accepts valid input when adding a new person and displays .

Reasoning

Invalid input can lead to data inconsistencies and usability issues in our application. By implementing validation logic on the client side, we ensure that users provide valid input before submitting forms, improving data quality and user experience.

Testing

  • Tested validation logic with various input scenarios, including empty fields, invalid characters, and incorrect formats.
  • Verified that error messages are displayed correctly and submission is blocked until valid input is provided.
  • Conducted manual testing to ensure that the user interface remains responsive and intuitive.

Related Issues

Fixes #1039

Steps to Test

  1. Go to peoples
  2. Click On add a new person
  3. enter invalid input in First Name, Last name ( numerical values)
  4. enter invalid input in phone number (alphabetical values)
  5. check the error message with the new update, no error message currently

Screenshots

This is the Before, no error message appears when entering invalid input
image
The after:
image
the screenshot above shows that when entering invalid input , it shows error and you cannot add another person unless you respect the regular expressions

If your changes include visual updates, it would be helpful to provide screenshots of the before and after.

Additional notes

  • This pull request follows the project's coding guidelines and best practices.
  • Feedback and suggestions for improvement are welcome.

Checklist

  • [ yes] I have tested these changes
  • I have updated the relevant documentation
  • [yes ] I have commented my code, particularly in hard-to-understand areas
  • [yes ] I have made corresponding changes to the codebase
  • [yes ] My changes generate no new warnings or errors
  • [yes ] The title of my pull request is clear and descriptive

Ouchi-Ranim and others added 6 commits March 9, 2024 23:33
Implemented validation logic with modifying the rules in the Dynamic Form index.js using pattern  to prevent users from submitting invalid input for form fields including first name, last name, and phone number. Added client-side validation checks using regex (regular expressions) to ensure that input meets specified criteria before form submission with a clear message for user when they enter an invalid input. .
preventing invalid input in form fields
Copy link

@Skanderloueti Skanderloueti left a comment

Choose a reason for hiding this comment

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

I tried this and it's working fine. Thank you for the efforts!

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