7. JavaScript form programming: Get form reference: var oform = document. getElementById ("form1"); var oform = document. forms [0]; if no subscript is required, the set of all forms is obtained. Var oform = document. forms ["formz"]; get the form named formz. Access form field: var temp = oform. elements [0]; obtain the first field of the form. Var temp = oform. elements ["text1"]; The field named text1 is obtained. Var temp = oform. textbox1; the field textbox1 is obtained. Var temp = oform ["text box 1. Common form fields: disabled attributes: user input and submission are not allowed. Form attribute: This attribute returns a form containing fields. Blur () method: This method causes the form field to lose focus. Focus () method: This method causes the form field to get the focus. Blur event: this event is triggered when the form field loses focus, and then the onblur event handler is executed. Focus event: this event is triggered when the form field obtains focus, and then the onfocus event handler is executed. Form submission: oform. submit (); form Reset: <input type = "button" value = "Reset" onclick = "document. forms [0]. unlike submit (), the reset () method still triggers the reset event, and the onreset event handler is still executed. Form Verification: prevents errors before they occur. Form validation best practices: 1. it must be helpful to the user; 2. 3. maxlength control length; 4. show all errors at a time; 5. capture errors earlier; 6. if you are not sure, do not be too strict.