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

Add form validation example #1175

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sriharish
Copy link

@sriharish sriharish commented Oct 2, 2024

This pull request removes the existing credit-card-form example and adds a general form validation example for registering a new user as per #1148.

What was Removed

  • Removed examples/credit-card-form/* as suggested by the comment here

What was Added

  • Added example program for validating "new users" in form-validation/main.go.
  • It features error validation messages that appear below the form (and only once the form submission has been attempted at least once with a keypress enter after signature).
  • The errors are removed as the user corrects the text inputs.
  • Submission (on keypress enter when the cursor is on the last text input) is prevented if errors persist.
  • A border style was added around signature for aesthetic purposes

With Errors

image

Successful Submission

image

@sriharish

This comment was marked as duplicate.

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.

1 participant