|
August 11, 2000 Cross-Element Referencing via a Back Door Tips: August 2000
Yehuda Shiran, Ph.D.
|
|
Back-door referencing allows you to access a form from its descendent elements. The form property enables this back-door access. When you send the object this to an event handling function, the ancestor form object cannot be restored, unless you use the back-door form property of the element. The following example demonstrates this concept. When you click the button, the button's object (this) is sent to the event handling function. This function accesses the second element of the form (text field) through the back-door form property, and prints out the text entry currently displayed in the entry field. Here are the button and the text entry field:Here is the script and HTML segment that implement the above demo:
People who read this tip also read these tips: Look for similar tips by subject: |