> >> Hello,
> >> I would appreciate any assistance you have with the following
[quoted text clipped - 104 lines]
> The strange thing is the fact that if I add an alert inside the do
> loop then it properly selects all related options.
Ahh, now that is more informative. I suspect that the javascript is
executing before the browser has built the references to the html
components. Using the javascript console on Mozilla/Firefox should
confirm this.
Try wrapping that up in a function called after the page loads.
Matt Ratliff - 31 Jul 2006 19:06 GMT
>> >> Hello,
>> >> I would appreciate any assistance you have with the following
[quoted text clipped - 110 lines]
>confirm this.
>Try wrapping that up in a function called after the page loads.
Paul,
Okay, that did it. By adding the alert it must have given the
script the time it needed to reference the component. After the last
coorespondence I added this code which worked for the time being. It
used the same principle that you were reffering to, by waiting for the
script to complete:
call charout , 'window.onload += '
call charout , 'setTimeout('''
call charout , 'opts=parent.document.getElementById("misc3");'
do zz=1 to xref4s~items
call charout , '
opts.options['xref4s[zz]['FARMTYPEUID']-1'].selected=true;'
end
call charout , ''',100)'
call charout , '0d0a'x
It built a string of the data, and passed it to the setTimeout
function to wait 100 ms. By appending it the window.onload it was
waiting until the load completed before processing the commands. I
really didnt even need the setTimeout function. The end result was as
you suggested. I replaced this with a function call invoked by the
windows onload event. Thanks for the help!