The Wayback Machine - https://web.archive.org/web/20111012002915/http://www.webreference.com/programming/javascript/form/index.html

spacer

home / programming / javascript / form current pageTo page 2To page 3
[next]

C/C++ Developer (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
Eclipse Helios Update Brings New PHP Tools
Internet Explorer 9 Ups Standards Support
JBoss Portal 5 Release Easier to Use


Form Elements Overlapping A Styled Layer

During the process of HTML coding you've probably encountered an annoying form element related problem, which could be described as Form Elements Overlapping a Styled Element. Today, I'll discuss this problem and present an effective workaround for it. If you're wondering why this is a workaround and not a permanent solution, it's "because the big guys (Netscape and Microsoft) don't have one."

Let's get to the heart of the matter. This peculiar behavior is caused by the default viewing priorities of the HTML elements. For example:
  1. A frame will take priority over all other html elements and will be displayed on top.
  2. A form element will take priority over any of the non-form elements
Below are some examples of form elements and non-form elements:

  Form Elements
  • Textarea
  • Select - list box or drop down
  • input type text
  • input type radio
  • input type checkbox
  Non-Form Elements
  • anchor tag (link)
  • div tag
  • span tag
  • and table tag and all of its tributory elements (thead, tfoot, tbody, tr, td)

Among the HTML elements mentioned above are some elements which are known as windowed elements and windowless elements. Today's problem concerns windowed elements. What happens is that the operating system (by default) paints these elements on top of any of the windowless elements that may appear on a given HTML page. At this point, if you think the CSS property z-index is supposed to control the overlapping order of display for any HTML element, then you're right, it should. However, the z-index has no bearing on windowed elements in comparison with the windowless elements.

 Below are some examples of windowed and windowless elements:

  Windowed Elements

  • SELECT elements.  
  • <OBJECT> tag elements.  
  • Plug-ins.  
  • IFRAMEs in IE 5.01 and earlier.
  Windowless Elements

  Netscape/Mozilla

In NS browsers below version 6 all of the form elements have a higher priority as compared with other HTML elements, such as links, tables or layers. However, in NS 6+ browsers, the IFRAME element and all the form elements are displayed according to the z-index property value or in the sequence they appear in the HTML page, except the "SELECT" element.

  Internet Explorer

In the most current IE browser (6.0), the IFRAME element and all the form elements are displayed according to the z-index property value or in the sequence they appear in the html page,except the "SELECT" element.

  Opera

In latest Opera (7.10_) browser, all of the form elements including the "SELECT" element are displayed according to the sequence of their presence or z-index. However, the latest version of Opera does not render IFRAME as windowless element. Instead, it's displayed as a windowed element and takes precedence in the display order over any other windowless element.

home / programming / javascript / form current pageTo page 2To page 3
[next]

Internet.com
The Network for Technology Professionals

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Flashmaps' DynamicLocator: Interactive Maps for Small Areas · Flashmaps' AreaSelector: Interactive Maps for Wide Areas · The DB Mapper: Interactive Street-level Maps of U.S. and Canada
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Vocalocity launches telephony/app integrations for Desktop · How to Reanimate Dead Spots in Wi-Fi Networks · PC Buyer's Guide for Gaming Enthusiasts

Created: June 2, 2003
Revised: June 2, 2003

URL: http://webreference.com/programming/javascript/form