Picture a named form with contents defined as follows:
[HTML]
<form name="myform">
<div id="extrawhatever" style="visibility: 'hidden'> <!-- div and select do share -->
<select name="extrawhatever"> <!-- common name/id value -->
<!-- options will be filled in dynamically later -->
</select>
</div>
<input type="text" name="whatever" id="whatever" onfocus="prepmyList();">
...
</form>
[/HTML]
As I understand things, if an form element has focus its container (form) MUST exist in the memory space right??? If I can use getElementById('whatever') on one line of code it should also work on the next line? So now the focus handler contains:
Expand|Select|Wrap|Line Numbers
- function prepmyList(arg) {
- var x = new getObj('extra'+arg); // ref hidden div from above by id so I can
- // make it visible after it is populated
- ...
- }
- function getObj(arg) {
- this.obj = document.getElementById(arg); // THIS WORKS FINE!!!!
- this.style = document.getElementById(arg).style; // ERROR NO PROPERTIES
- ....
- }
This is driving me on the short trip to CRAZY. Anybody got a grip on it? Any ideas will be greatly appreciated.
Impeach the whole government!
Dan Ellison