tailieunhanh - Core Servlets and JavaServer Pages phần 8

và kiểm tra nếu điều kiện đã từng được thiết lập một cách rõ ràng (setHasCondition và getHasCondition), vì chúng ta muốn csajsp không cho phép: nếu thẻ không chứa csajsp: điều kiện nhập. Liệt kê 14,23 cho thấy mã cho IfTag. Bước thứ hai là xác định một xử lý thẻ cho csajsp: điều kiện. Lớp học này, được gọi là IfConditionTag, | Prentice Hall and Sun Microsystems. Personal use only do not redistribute. Chapter 16 Using HTML Forms Check boxes HTML Element INPUT TYPE CHECKBOX NAME . . No End Tag Attributes NAME required VALUE CHECKED ONCLICK ONFOCUS ONBLUR This input element creates a check box whose name value pair is transmitted only if the check box is checked when the form is submitted. For instance the following code results in the check box shown in Figure 16-14. P INPUT TYPE CHECKBOX NAME noEmail CHECKED Check here if you do I not I want to get our email newsletter 1 Check here if you do ỈỈŨÍ want to get our email newsletter Figure 16-14An HTML check box. Note that the descriptive text associated with the check box is normal HTML and care should be taken to guarantee that it appears next to the check box. Thus the P in the preceding example ensures that the check box isn t part of the previous paragraph. Core Approach Paragraphs inside a FORM are filled and wrapped just like regular paragraphs. So be sure to insert explicit HTML markup to keep input elements with the text that describes them. NAME This attribute supplies the name that is sent to the server. It is required for standard HTML check boxes but optional when used with JavaScript. VALUE The VALUE attribute is optional and defaults to on. Recall that the name and value are only sent to the server if the check box is checked when the form is submitted. For instance in the preceding example noEmail on would be added to the data string since the box is checked but nothing would be added if the box was unchecked. As a result servlets or CGI programs often check only for the existence of the check box name ignoring its value. Home page for this book Home page for sequel . Servlet and JSP training courses by book s author . Prentice Hall and Sun Microsystems. Personal use only do not redistribute. Check Boxes and Radio Buttons CHECKED If the CHECKED attribute is

TỪ KHÓA LIÊN QUAN