-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Write new basic forms article for learn #37776
Write new basic forms article for learn #37776
Conversation
Preview URLs External URLs (1)URL:
(comment last updated: 2025-01-27 16:55:07) |
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
Form validation is a huge topic that is beyond scope for this article, so we will leave it here for now. For now, bear in mind that there are two types of form validation: | ||
|
||
- Client-side validation, which happens in the browser, implemented using a combination of form validation attributes (like `required`) and JavaScript. Client-side validation is useful for giving users instant hints when they entered the wrong data, but is no so effective at stopping malicious data from getting through. It is too easy to turn off JavaScript or alter client-side code so that the validation no longer works. | ||
- Server-side validation, which happens on the server, implemented using whatever language the server is using. Server-side validation is great for stopping malicious code, as it can't be tampered with easily. It is not so good at giving users hints about incorrect data as the data has to go to the server, get validated, and then the result sent back to the client before the user can be notified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit wordy, but I wanted to note that it can happen accidentally or on purpose that your sever receives weirdly-formatted messages, and the motivation doesn't matter, you shouldn't trust client data (will be in a proper format):
- Server-side validation, which happens on the server, implemented using whatever language the server is using. Server-side validation is great for stopping malicious code, as it can't be tampered with easily. It is not so good at giving users hints about incorrect data as the data has to go to the server, get validated, and then the result sent back to the client before the user can be notified. | |
- Server-side validation, which happens on the server in whatever language the server is running. Badly-formed messages can be sent to a server by accident or on purpose. The conventional wisdom is to make sure that your server doesn't trust anything a client is sending to avoid bugs or security issues caused by malformed messages. Server-side validation is great for stopping malicious messages, as it's harder to tamper with the code running on the server. Server-side validation is not so good at giving users hints about incorrect data because the data has to go to the server, get validated, and then the result is sent back to the client before the user can be notified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you've got a good point here. I used your text but tweaked it a bit.
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/core/structuring_content/html_forms/index.md
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Chris - couple of suggestions, but leaving a +1 for when you've had a look!
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
…l_forms/index.md Co-authored-by: Brian Smith <[email protected]>
We are merged. Cheers for the great review, @bsmth! |
Thanks a lot 🙏🏻 |
Description
This PR updates the Learn web development Forms and buttons in HTML article, which is currently incomplete.
A couple of notes:
Motivation
Additional details
Related issues and pull requests