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 Immediate Error Message Display on Form Load #39

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

Conversation

Praneeth-2602
Copy link

Solves issue #38

Problem: The error message, "Please fill all the fields before submitting!" appeared on page load, instead of after the user tried to submit the form.

Solution:

Removed logic that disabled the submit button, allowing form submission anytime.
Added a formSubmitted state to track if the user attempted submission.
Updated error display logic to show messages only after submission, and only if fields are incomplete.
Form submission is blocked if fields are missing, and the error message is shown.
Key Changes:

Error messages only appear after attempted submission.
Submit button is always enabled.

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 great! there are CI errors. Can you fix? @Praneeth-2602 I'll merge then. Also change the name of the PR from "Solved the issue" to something meaningful

@Praneeth-2602
Copy link
Author

@suryabulusu sure will!!

@Praneeth-2602 Praneeth-2602 reopened this Oct 25, 2024
@Praneeth-2602 Praneeth-2602 changed the title Solved the issue #38 Fix Immediate Error Message Display on Form Load Oct 25, 2024
@Praneeth-2602
Copy link
Author

@suryabulusu Done sir.

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