tailieunhanh - Javascript bible_ Chapter 21

Tham khảo sách 'javascript bible_ chapter 21', 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ả | The Form Object The majority of scripting in an HTML document takes place in and around forms. Because forms tend to be the primary user interface elements of HTML documents this fact shouldn t be surprising. The challenge of scripting forms and form elements often comes from getting object references just right The references can get pretty long by the time you start pointing to the property of a form element which is part of a form which is part of a document which is part of a window or frame . The Form in the Object Hierarchy Take another look at the JavaScript object hierarchy in Navigator 4 refer back to Figure 16-1 . The form object can contain a wide variety of form element objects which are covered in Chapters 22 through 24. In this chapter however the focus is strictly on the container. The good news on the compatibility front is that with the exception of differences when submitting forms to CGI programs on the server much of the client-side scripting works on all scriptable browsers. Where differences exist I point out the real gotchas. Form Object In This Chapter The form object as container of form elements How to submit forms via e-mail Processing form validations Properties Methods Event Handlers action handleEvent onReset elements reset onSubmit encoding submit length method name target 414 Part III JavaScript Object and Language Reference Syntax Creating a form FORM NAME formName TARGET windowName ACTION serverURL METHOD GET POST ENCTYPE MIMEType onReset handlerTextOrFunction onSubmit handlerTextOrFunction FORM Accessing form properties or methods window. method parameters window. index .property method parameters About this object Forms and their elements are the primary two-way gateways between users and JavaScript scripts. A form element provides the only way that users can enter textual information or make a selection from a predetermined set of choices whether those choices appear in the form of an on

TỪ KHÓA LIÊN QUAN