- The React Workshop
- Brandon Richey Ryan Yu Endre Vegh Theofanis Despoudis Anton Punith Florian Sloot
- 208字
- 2021-06-11 18:28:30
Designing the State of Our Application
A typical pattern in modern web applications is that when there is a form with multiple input fields, one input field might rely on another input field. For example, a password field may affect a password confirmation field by requiring that the two fields match with each other. While this validation is being performed, there is another validation happening which will prevent the user from clicking the submit button if there are errors. In addition, there will be other fields that will affect each other. For example, a password field may require the password to be different from the username entered. For the purpose of our example, we are going to build a form where someone can sign up for an account. They will need to enter:
- A username
- A password
- A password confirmation
- An email address
In terms of validations, we will want to make sure that:
- The username is filled out.
- The password is filled out.
- The password matches the confirmation.
- The email address is at least in the format of (someusername)@(somedomain.com).
- The submit button is grayed out if there are any errors.
Note
We are intentionally using an overly simplistic method of validating email addresses here to avoid complexity.
- Vue.js 3.x快速入門
- SPSS數(shù)據(jù)挖掘與案例分析應(yīng)用實踐
- Visual Studio 2012 Cookbook
- Building a Game with Unity and Blender
- 造個小程序:與微信一起干件正經(jīng)事兒
- AWS Serverless架構(gòu):使用AWS從傳統(tǒng)部署方式向Serverless架構(gòu)遷移
- Learning Firefox OS Application Development
- Visual Basic程序設(shè)計習題解答與上機指導(dǎo)
- 21天學通C++(第6版)
- 名師講壇:Spring實戰(zhàn)開發(fā)(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- Clojure Reactive Programming
- 深入理解Android:Wi-Fi、NFC和GPS卷
- QGIS 2 Cookbook
- Everyday Data Structures
- 深入理解BootLoader