Sorry, yeah, I wasn't being very clear.
The number and name of those functions would be dynamic based on data
from the database so I wouldn't know their names during onload. I got
caught in a catch 22 where I couldn't preload all the functions in the
body onload because the data would be determined later in the page.
You know, can't move this code here, because it relies on this code
over here and as the page loads, there's a sequential logic to it. I'm
on round three of client modification, so my code is not as robust as
it was when I planned it out.
What I did that's working at the 95% level and needs to be slightly
debugged was to go in at the onFocus and run the dynamic number of
functions based on using the substring function and having similarly
named divs. There's a slight bug, but since all the div names follow a
pattern, then that seems to do the trick.
Don
Randy Webb wrote:
Quote:
bbcrock@gmail.com said the following on 7/26/2006 4:31 PM:
Quote:
I take my hat in hand with a question.
I have dynamically named form elements set in divs based on a
server-side language. I am displaying these using DHTML in a
display:none, display:block format.
>
Why? Have the server set it.
>
Quote:
Due to some code (and deadline) issues I do not have the total number
of form elements set by the time the body tag is run. I wanted to have
a script tag later on in the document which reads something like:
<query>
<builds div element1i1, element1i2, etc>
<script language="javascript">
document.getElementById(' query variable '+1).style.display = 'block';
</script>
</query>
However the JavaScript code does not run. Alerts run inside the code
consistently, but the other code does change the display to block.
>
window.onload=someFunction;
>
function someFunction(){
document.getElementById(' query variable '+1).style.display = 'block';
}
>
Where the query variable is inserted by the server.
>
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/