TAILIEUCHUNG - Học php, mysql và javascript - p 29

Xây dựng hình thức Xử lý các hình thức là một quá trình nhiều lần. Trước tiên, mẫu được tạo ra vào đó một người dùng có thể nhập các chi tiết cần thiết. Dữ liệu này sau đó được gửi đến máy chủ web, nơi mà nó được giải thích, thường với một số kiểm tra lỗi. Nếu mã PHP xác định một hoặc nhiều lĩnh vực cần reentering, hình thức có thể được hiển thị lại với một thông báo lỗi | Figure 11-6. Creating a drop-down list with select Example 11-7. Using select Vegetables select name veg size 1 option value Peas Peas option option value Beans Beans option option value Carrots Carrots option option value Cabbage Cabbage option option value Broccoli Broccoli option select This HTML offers five choices with the first one Peas preselected due to it being the first item . Figure 11-6 shows the output where the list has been clicked on to drop it down and the option Carrots has been highlighted. If you want to have a different default option offered first such as Beans use the selected tag like this option selected selected value Beans Beans option You can also allow for the selection of more than one item by users as in Example 11-8. Example 11-8. Using select with the multiple parameter Vegetables select name veg size 5 multiple multiple option value Peas Peas option option value Beans Beans option option value Carrots Carrots option option value Cabbage Cabbage option option value Broccoli Broccoli option select This HTML is not very different only the size has been changed to 5 and the tag multiple has been added. But as you can see from Figure 11-7 it is now possible to select more than one option by using the Ctrl key when clicking. You can leave out the size parameter if you wish and the output will be the same but with a larger list it might take up too much screen space so I recommend that you pick a suitable number of rows and stick with it. I also recommend against multiple select boxes smaller than two rows in height some browsers may not correctly display the scroll bars needed to access it. Retrieving Submitted Data 261 Figure 11-7. Using a select with the multiple parameter You can also use the selected tag within a multiple select and can in fact have more than one option preselected if you wish. Labels You can provide an even better user experience by utilizing the label tag. With it you can surround a form element making it .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.