using innerHTML instead of form input

admin

Administrator
Staff member
I downloaded a script that retrieves the latest update and returns the query to a new window.

Original relevant script:
....
<A
href="javascript:update()">See latest update.</A>
...
function update()
{
myWindow = window.open("","myWindow","width=400,height=250");
myWindow.document.write('<html><body bgcolor="gray">');
myWindow.document.write('<h2 style="font:bold 16px Arial,sans-serif; vertical-align:middle;">Please wait for updated data...</h3><form action="http://foo.com/cgi/get_update.pl" name="update_form">')
myWindow.document.write('<input type="hidden" value=http://www.webdeveloper.com/forum/archive/index.php/"1" name="get_update"></form></body></html>');
myWindow.document.update_form.submit();
}
...

I haven't spent much time with forms, so I'm stumped after trying to rewrite the script the script to write to an inline tag within the document. All I'm getting is an "object doesn't support this method or property message".

Attempted rewrite:
...
<span id="curUpdate">&nbsp;</span>
...
function update()
{
curUpdate.innerHTML.write('Please wait for updated data<form action="http://foo.com/cgi/get_update.pl" name="update_form">');
curUpdate.innerHTML.write('<input type="hidden" value=http://www.webdeveloper.com/forum/archive/index.php/"1" name="get_update"></form>');
curUpdate.innerHTML.update_form.submit();
}
document.onload=update
...

What am I doing wrong?:confused:

TIA
 
Back
Top