form表单技巧
A well-designed form is a rarity, and a huge boost to any website. Most forms, online or off, are not well designed. Following a few simple rules will help both your client and their customers:
精心设计的表单非常罕见,并且可以极大地促进任何网站的发展。 大多数在线或非在线表单都没有经过精心设计。 遵循一些简单的规则将对您的客户及其客户都有帮助:
Users do not want to fill out forms. The more rewarding you can make the experience for them, the better. Offer them something: a discount, entry into a competition, a free brochure.
用户不想填写表格。 您可以为他们带来更多的收获,更好的体验。 给他们提供一些东西:折扣,参加比赛,免费的小册子。
Do not ask for information you don’t need. The less the user has to fill out, the more likely s/he is to complete the form. Make areas of the form that are optional clearly voluntary.
不要索取不需要的信息。 用户填写的次数越少,完成表格的可能性就越大。 使可选形式的区域明确自愿。
- If you have to ask for a lot of information, split the form into several pages, retaining the information the user has filled out on the first page in a session cookie or other technology. (We will be covering these possibilities next semester). 如果您需要大量信息,请将表格分成几页,保留用户在会话cookie或其他技术的第一页上填写的信息。 (我们将在下学期探讨这些可能性)。
- Break requested information down into manageable and comprehensible units. Do not ask for a person’s name in a single field; instead, ask for their first and last names in separate fields. 将请求的信息分解为可管理和可理解的单元。 不要在单个字段中要求提供姓名; 而是在单独的字段中询问其名字和姓氏。
Rather than asking for telephone area code and the rest of the phone number on separate lines, make them two or three fields next to each other, with brackets to indicate where the area code should be entered, like this:
不要将电话区号和电话号码的其余部分放在单独的行上,而是将它们彼此相邻的两个或三个字段,并用方括号指出应该在哪里输入区号,例如:
<label for="areacode">Phone</label> (<input name="areacode" type="tel" id="areacode" size="3">) <input name="phoneno" type="tel" id="phoneno" size="3"> <input name="phoneno2" type="tel" id="phoneno2" size="4">
- Remember to include enough room for extraneous characters (the dash in a postal code, for example) that users may include by habit; typically, those will be stripped out before placing the information in a database. 记住要留出足够的空间容纳用户习惯使用的多余字符(例如邮政编码中的破折号); 通常,将这些信息删除后再将其放入数据库中。
If you're in a rush, and don't mind using something with less customisation, you could use a form builder, such as Wufoo, JotForm, or FormAssembly. All of these utilities also offer basic form processing and eMail response, meaning that you do not have to write your own PHP.
如果您很着急,并且不介意使用定制程度较低的功能,则可以使用表单构建器,例如Wufoo , JotForm或FormAssembly 。 所有这些实用程序还提供基本的表单处理和电子邮件响应,这意味着您不必编写自己PHP。
form表单技巧