I came across T. Greer's very clever demonstration of how to provide an HTML combobox at http://www.tgreer.com/comboArticle.html. I realised, however, that for the purposes of the demonstration the example combobox is placed at an absolute position on the page. I tried to make it dynamic, but have encountered difficulties. Would someone be kind enough to help? (I'm a novice JavaScript programmer.)
Take the original and comment out the '<style type="text/css">...<!--<style type="text/css">' near the top. Alter the order of the HTML of the selector and the input box so that the selector is first. (This does away with the need to use .zIndex, which I couldn't make work in any case.) Remove the 'class="DropDown"' from the selector and the 'class="TxtBox"' from the input box. Add an initial paragraph of text and a reset button. Then change the content of the ieStinks() JavaScript procedure to get the attached HTML/JavaScript file.
This works fine with Firefox on Linux. I've not been able to try it with Internet Explorer. My problem is that I'd like to use the calculated values for selector.style.width, textbox.style.width and the upward adjustment of the textbox position: '"-" + textbox.style.height', but find that only the literal values ("120px", "100px" and "-20px") work. There is also a minor aesthetic problem: the definition of "relative" (see "javascript: The Definitive Guide" by David Flanagan, O'Reilly) says that "The space allocated for the [relative-re-positioned] element in the normal document flow remains allocated for it, and the elements on either side of it do not close up ...". Can this be avoided without repositioning other elements by hand, which would be a nuisance?
The ideal, of course, is to have ieStinks(), fakeCombo() and mySelect() process any synthesized comboboxes placed in the HTML page automatically, without having to pass these procedures their names.