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 trigger validation on submit #149

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

MartinBenediktBusch
Copy link
Collaborator

@MartinBenediktBusch MartinBenediktBusch commented Feb 8, 2024

Overview

This PR addresses an issue where users were unable to submit the form if there were validation errors. Previously, the button was disabled when the form was invalid, preventing users from clicking it and triggering validation checks.

Changes Made

  1. Changed the button element from <Button type="submit" disabled={!isValid}> to <Button type="submit">Submit</Button>.
  2. Added a conditional check if(isValid) {}for form validity inside the submit handler:

Outcome

With these changes, users can now click the submit button to trigger validation checks. If there are any validation errors, they will be notified. Once all required fields are filled out correctly, users can successfully submit the form.

@MartinBenediktBusch MartinBenediktBusch self-assigned this Feb 8, 2024
Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
forum-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 9, 2024 2:33pm

@MartinBenediktBusch MartinBenediktBusch changed the base branch from main to develop February 8, 2024 10:51
@MartinBenediktBusch MartinBenediktBusch linked an issue Feb 8, 2024 that may be closed by this pull request
@MartinBenediktBusch MartinBenediktBusch linked an issue Feb 9, 2024 that may be closed by this pull request
packages/berlin/src/pages/Account.tsx Outdated Show resolved Hide resolved
@MartinBenediktBusch MartinBenediktBusch merged commit 6cff111 into develop Feb 9, 2024
4 checks passed
@MartinBenediktBusch MartinBenediktBusch deleted the trigger-validation-on-submit branch February 9, 2024 14:35
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.

Not selecting an affiliation Submit button at /account not triggering validation
2 participants