From 52832fff9048482a5036a96d0a7c05cc238b9153 Mon Sep 17 00:00:00 2001 From: Vedran Leder Date: Tue, 11 Dec 2018 16:02:36 +0100 Subject: [PATCH] Add section on validation (#27286) --- guide/english/html/html-forms/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guide/english/html/html-forms/index.md b/guide/english/html/html-forms/index.md index 515c52a7b6..142e1a59c7 100644 --- a/guide/english/html/html-forms/index.md +++ b/guide/english/html/html-forms/index.md @@ -90,5 +90,9 @@ The form tag can also have an attribute named "target" which specifies where the The action attribute defines the action to be performed when the form is submitted. Normally, the form data is sent to a web page at the Script URL when the user clicks on the submit button. If the action attribute is omitted, the action is set to the current page. + +## Form Validation +Form validation guarantees that user provided all the required data in a correct way. There are 2 broad types: **client-side** and **server-side** validation. Client-side validation can be done via JavaScript or HTML5 (required attribute for instance). It gives helpful and instant feedback to the user. Server-side validation is performed before data is saved to the database to avoid saving incorrect or even dangerous data. Usually, both types of validation should be implemented to get the best of the both worlds: great UX and proper security. + ## More information - [Wikipedia](https://en.wikipedia.org/wiki/Form_(HTML))