A 'name' attribute must also be unique to the form, as this is how the plugin keeps track of all input elements.
However, each group of radio or checkbox elements will share the same 'name' since the value of this grouping represents a single piece of the form data.
It checks to see if the required fields are there, and if not, saves an error message into a variable for display: The difference with how the CGI writes the error message is that instead of a "\n", it uses the HTML paragraph tag to put a new line in between each error.
In addition, since this is a filter and not an action (read more about the difference here) we're also telling Gravity Forms that we'd like to modify the validation result and continuing processing the rest of the validation with those modifications preserved.
When you submit a page on a multi-page form, Gravity Forms will populate some additional info in the $_POST global (read more here if you're unfamiliar with the $_POST).
Having both in place gives you the necessary security for your application, as well as improved usability.
Mandated: A 'name' attribute is required for all input elements needing validation, and the plugin will not work without this.
For example, suppose you wanted to validate a credit card.
All credit cards are 16 digits and the 16th digit can be calculated based on the first 15 numbers.
In client side validation the data is validated in the browser using Java Script before submitting the data to the server.
For example, suppose your user submits the form without entering a mandatory field.
By validating form responses before accepting them, we can alert users to their errors before they submit the form.
In this way, client side form validation can vastly improve the user experience.
Optionally: Each input can have a label associated with it, where the 'for' attribute of the label refers to the 'id' attribute of the input.