Fix translation for section "Forms" in 14.3.md

This commit is contained in:
Anchor
2015-02-15 22:56:13 -08:00
committed by James Miranda
parent 630659b650
commit 1e1e27cef9

View File

@@ -1,21 +1,21 @@
# 14.3 Form
# 14.3 Forms
In Web Development For such a process may be very familiar:
In web development, the following workflow will probably look quite familiar:
- Open a web page showing the form.
- Users fill out and submit the form.
- If a user submits some invalid information, or you might have missed a required item, the form will be together with the user's data and the error description of the problem to return.
- Users fill in again to continue the previous step process until the submission of a valid form.
- Open a web page showing a form
- Users fill out and submit the form
- If a user submits some invalid information or has neglected to fill out a required field, the form will be returned to the user (along with the filled in data) with some descriptive information about the problem.
- Users re-fill the invalid fields and continue attempting to submit the form until it's accepted
At the receiving end, the script must:
- Check the user submitted form data.
- Verify whether the data is the correct type, the appropriate standard. For example, if a user name is submitted, it must be verified whether or contains only characters allowed. It must have a minimum length can not exceed the maximum length. User name can not already exist with others duplicate user name, or even a reserved word and so on.
- Filtering data and clean up the unsafe character that guarantees a logic processing received data is safe.
- If necessary, pre-formatted data( or data gaps need to be cleared through the HTML coding and so on. )
- Preparing the data into the database.
- Verify whether the data is the correct type and of the appropriate standard. For example, if a username is submitted, it must verify that it contains only valid characters. Other examples would be checking for minimum and maximum lengths, username uniqueness, and so on.
- Filtering data and cleaning up unsafe characters to guarantee that our application only processes data which is safe.
- If necessary, pre-format the data (or data gaps need to be cleared through the HTML coding and so on.)
- Prepare the data for insertion into the database
While the above process is not very complex, but usually need to write a lot of code, and in order to display an error message on the page often use a variety of different control structures. Create a form validation, although simple to implement it boring.
Although the procedure is not very complex, it usually requires a lot of boilerplate. In addition, web applications often use a variety of different control structures to display error messages on returned pages. Implementing form validation is a simple but boring task.
## Forms and validation