PRB: "Is Not An Object" Error When Submitting Incomplete DocID: Q190279
|
When an HTML page with a form is dynamically created using document.write() and the page does not include fundamental HTML tags and is submitted, the following error occurs in Internet Explorer 4.01:
Error: <reference to the form> is not an object
Fundamental HTML tags should always be used in HTML pages. The lack of them can potentially cause a problem in various browsers or versions of browsers.
Adding <html>, <head>, <title>, and <body> tags to the dynamically created document prevents the error from occurring.
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
parent.frame2.document.open() ;
// added line
parent.frame2.document.write('<HTML><HEAD><TITLE>a</TITLE>') ;
parent.frame2.document.write('</HEAD><BODY>') ;
parent.frame2.document.write('<form method="POST" name="list" ') ;
parent.frame2.document.write('<action="feedback.exe">') ;
parent.frame2.document.write('<input type="hidden" name="Name" ') ;
parent.frame2.document.write('value="x">') ;
parent.frame2.document.write('</form>') ;
// added line
parent.frame2.main.document.write('</BODY></HTML>') ;
// error occurs here if the other commented lines are not included.
parent.frame2.main.document.list.submit() ;
parent.frame2.document.close() ;
http://www.microsoft.com/msdn/sdk/inetsdk/help/default.htm
Additional query words: kbHTML kbScript kbIE
Keywords : kberrmsg kbScript
Version : WINDOWS:2.0,3.0,4.0,4.01
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 12, 1999