Skip to content

Add validation to Contact field - #81

Merged
nightwatchcyber merged 4 commits into
securitytxt:masterfrom
joker314:contact-validation
Jul 9, 2021
Merged

nightwatchcyber merged 4 commits into
securitytxt:masterfrom
joker314:contact-validation

Conversation

@joker314

@joker314 joker314 commented Jul 8, 2021

Copy link
Copy Markdown
Contributor

This is a quick fix, and it may be a good idea to follow up with a more long-term solution to validation.

The input box gets a red border and a piece of text underneath describes the validation issue

The above message appears as the user is typing. If the user chooses to submit despite the warning, the input box regains focus (thus scrolling them so that the input box is on screen), the security.txt file is not generated, and an additional red box appears at the top.

The red box is larger and gives an example of how to format an email address

The red box does not disappear until the user submits the form again, even after they have corrected all the issues.

Note: the validation only checks that the input begins with https://, mailto: or tel:. It does not validate the content afterwards (such as whether there is an @ if mailto: is used) but this can potentially be added in a follow-up PR.

@rugk

rugk commented Jul 9, 2021

Copy link
Copy Markdown

IMHO a god usability would be, if I enter mail@example.com and press Tab or so, that it "autocompletes" the field to mailto:mail@example.com and thus "auto-corrects" the error.

After all, the advantage of this website is to simplify things, and I as a user should not worry about the exact syntax…

@nightwatchcyber

Copy link
Copy Markdown
Contributor

IMHO a god usability would be, if I enter mail@example.com and press Tab or so, that it "autocompletes" the field to mailto:mail@example.com and thus "auto-corrects" the error.

After all, the advantage of this website is to simplify things, and I as a user should not worry about the exact syntax…

@joker314 can you take a look?

@joker314
joker314 deleted the contact-validation branch July 12, 2021 16:27
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.

3 participants