Javascript bible_ Chapter 49

Tham khảo sách 'javascript bible_ chapter 49', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Application An Order Form I s the Web weeks roll on more transaction-based Web sites are coming online. When an online catalog presents an ordering option you generally need to present an order form of some kind for the user to enter the desired quantity stock number and so on. Without the help of JavaScript building an order form in HTML is tedium to the nth degree. Enabling JavaScript to do the math is also normally a tedious process if you haven t been efficient in the way you define all the input fields in the form. In this chapter I present one example of how to script an order form so that it s easy to maintain and involves an incredibly small amount of scripting and HTML code for the amount of work it does. Defining the Task I doubt that any two order forms on the Web are executed precisely the same way. Much of the difference has to do with the way a CGI program on the server wants to receive the data on its way to an order-entry system or database. The rest has to do with how clever the HTML programmer is. To come up with a generalized demonstration I had to select a methodology and stay with it. Because the intended goal of this demonstration is to focus on the rows and columns of an order form I omit the usual name-and-address input elements. Instead the code deals exclusively with the tabular part of the form including the footer stuff of a form for subtotals sales tax shipping and the grand total. Another goal is to design the order form to enable as much reusability as possible. In other words I may design the form for one page but I also want to adapt it to another order form quickly without having to muck around too deeply in complicated HTML and JavaScript code. One giant annoyance that this method eliminates is the normal HTML repetition of row after row of tags for input fields and table cells. JavaScript can certainly help you out there. The order form code also demonstrates how to perform math and display results in two decimal places how to .

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
12    26    1    29-11-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.