Navigator 2.0, Internet Explorer 3.0
element.name
name is a read-only string property of every form element. The value of this property is set by the NAME attributes of the HTML <INPUT> tag that defines the form element.
The name of a form element is used for two purposes. First, it is used when the form is submitted. Data for each element in the form is usually submitted in the format:
name=value
where name and value are encoded as necessary for transmission. If a name is not specified for a form element, then the data for that element cannot be meaningfully submitted to a web server.
The second use of the name property is to refer to a form element in JavaScript code. The name of an element becomes a property of the form that contains the element. The value of this property is a reference to the element. For example, if address is a form that contains a text input element with the name zip, then address.zip refers to that text input element.
With Radio and Checkbox form elements, it is common to define more than one related object, each of which have the same name property. In this case, data is submitted to the server with this format:
name=value1,value2,...,valuen
Similarly, in JavaScript, each of the elements that shares a name becomes an element of an array with that name. Thus if four Checkbox objects in the form order share the name "options," then they are available in JavaScript as elements of the array order.options[].
In Navigator 2.0, when multiple form elements are given the same name and placed in an array, they will only be placed in the array in the expected source order if they all define an event handler, even a dummy event handler that does nothing. If none of the elements define event-handlers, then they will be inserted into the array in reverse order. If some define event handlers and others don't, the order will be less predictable. In cases where array order actually matters, the workaround to this bug is to define dummy event handlers as needed.
file: /Techref/language/java/SCRIPT/definitive/refp_106.htm, 6KB, , updated: 2019/10/14 15:00, local time: 2024/11/25 18:31,
18.116.14.48:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/language/java/SCRIPT/definitive/refp_106.htm"> [Chapter 21] Reference: Element.name</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.