为何只靠占位符不够
一输入提示就消失,用户只能靠记忆(Sherwin, 2014)。受短时记忆限制(Miller, 1956)与认知负荷理论(Sweller, 1988)影响,错误会增加。
标签在外,提示靠近
把标签放在上方等指南能减少错误与时间(Seckler et al., 2014)。格式提示放在框旁(Christian et al., 2007)。错误提示见内联校验。
无障碍
浅灰占位符常不满足WCAG 2.2的1.4.3,加深对比度又像已填值。3.3.2要求提供标签。用label元素关联(W3C, n.d.)。
常见问题
- 完全不能用占位符吗?
- 只要不代替标签,可作简短示例。
- 浮动标签可以吗?
- 比只用占位符好,但要检查小字大小与对比度。
来源核查日期:2026-10-27
参考文献
- Sherwin, K. (2014, May 11). Placeholders in form fields are harmful. Nielsen Norman Group. 用占位符代替标签的问题。
- Seckler, M., Heinz, S., Bargas-Avila, J. A., Opwis, K., & Tuch, A. N. (2014). Designing usable web forms: Empirical evaluation of web form improvement guidelines. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (pp. 1275–1284). ACM. 表单指南减少错误与时间。
- Miller, G. A. (1956). The magical number seven, plus or minus two: Some limits on our capacity for processing information. Psychological Review, 63(2), 81–97. 短时记忆容量的经典。
- Sweller, J. (1988). Cognitive load during problem solving: Effects on learning. Cognitive Science, 12(2), 257–285. 无关认知负荷降低表现。
- Christian, L. M., Dillman, D. A., & Smyth, J. D. (2007). Helping respondents get it right the first time: The influence of words, symbols, and graphics in web surveys. Public Opinion Quarterly, 71(1), 113–125. 字段旁提示提升准确率。
- World Wide Web Consortium. (n.d.). Labeling controls. Web Accessibility Tutorials. label元素关联方法。
- World Wide Web Consortium. (2023). Web Content Accessibility Guidelines (WCAG) 2.2. 3.3.2与1.4.3标准。
