chap8-表单在网页中的使用(英文版).ppt
文本预览下载声明
Chapter 8 Forms Objectives Explain what forms are and how they work. List the commonly used form controls. Use common form controls correctly. Create usable and well-laid-out forms. What are forms? Forms provide an interface allowing users to interact in some way with your site. In most cases, they are used to gather user data, either for later use or to provide a customized response on the fly. Forms have a wide range of uses, from functions as simple as search boxes, mailing list signups, guestbooks, and surveys to as complex as online commerce systems. How forms work? Forms collect input via controls, such as buttons, text fields, or scrolling menus. Controls are placed on the page using special elements in the markup. These elements are merely an interface for collecting user information and do not actually process the data. The real work is done by forms-processing applications on the server, such as CGI scripts, ASP, ASP.NET, PHP, or JSP. The basic form element form … /form action attribute The action attribute in the form element provides the URL of the program to be used for processing the form. method attribute The method attribute specifies one of two methods, either get or post, for submitting the form information to the server. Form controls Single-line text entry fields Password entry fields Checkboxes Radio buttons Submit and reset buttons File upload mechanisms Custom and image buttons Input controls input type=“text” name=“name” size=“15” maxlength=“50” value=“enter your name here” / input type=“password” name=“password” size=“8” maxlength=“8” value=“abcdefg” / input type=“checkbox” name=“os” value=“WinXP” checked=“checked” / input type=“radio” name=“os” value=“WinXP” checked=“checked” / Input controls input type=“submit” value=“Go” / input type=“reset” value=“Reset” / input type=“button” value=“Push me!” / input type=“image” src=“sendme.gif” alt=“Send me” / input type=“file” name=“file” size=“15” maxlength=“50” / Other controls textarea name=“
显示全部