Học JavaScript qua ví dụ part 37

Về hình thức HTML Tại trung tâm của Web là hình thức. Nó được sử dụng để chuyển thông tin từ trình duyệt đến máy chủ. Bất cứ lúc nào bạn đi trực tuyến và đặt mua một cuốn sách, thương mại tại một cuộc đấu giá, hãy điền vào một cuộc khảo sát, hoặc gửi e-mail bằng cách sử dụng một trình duyệt Web | 334 Chapter 11 Working with Forms and Input Devices Table Methods of the document Object continued Method What It Does focus Brings the document into focus. getElementById Returns a reference to the first object with the specified ID. getElementsByName Returns a collection of objects with the specified name. getElementsByTagName Returns a collection of objects with the specified tag name. open Begins a new document erasing the old one. write Writes and appends text into the current document. writeln Same as writeO but appends a newline if in a pre tag. About HTML Forms At the heart of the Web is the form. It is used to pass information from the browser to the server. Anytime you go online and order a book trade at an auction fill out a survey or send an e-mail using a Web browser you are working with a form. An HTML form offers you a number of ways to accept input such as radio buttons checkboxes popup menus hidden fields and textboxes these are called virtual input devices or controls. Once the form has been filled out by a user it normally is sent to a server where the input is processed by a server-side program such as a Java servlet CGI or PHP application. It is important to understand how the form data is collected and sent to the server and then what role JavaScript has in this process. Attributes of the form Tag All forms are in HTML documents. They begin with a form tag and its attributes followed by the input fields where the user enters form information and end with a form tag. form name form1 id form1 action URL to server program method post input type text name town id town continue here with body of the form including input devices for filling out the form see Table for a complete example . form From the Library of About HTML Forms 335 The action Attribute. The action attribute is assigned the URL of the server program that will process the form data. After the user enters the information requested in the

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
497    208    3    21-05-2024
66    73    2    21-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.