472,145 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

"Object Required" error

I'm trying to write a somewhat simple page with dependent drop-down
boxes. Unfortunately the entire page is written through PL/SQL so that
makes it even more difficult for me to trouble shoot. I know hardly
anything when it comes to JavaScript, and I keep getting an error
saying:
"Error: Object required
Line: 31
Char: 1
Code: 0"

The funny thing is that I ONLY get this error with Internet Explorer.
The page works just fine in Firefox but most of my clients will be
using IE so this has been driving me nuts. Here is the code on the page
that is throwing the error (the page is displayed in a hidden frame).

<script language="javascript">
function lookUp( cntry_name )
{
document.forms[0].p_cntry_name.value = cntry_name;
document.forms[0].submit();
}
</script>

<script language="javascript">
function lookUpCounty( state_name )
{
document.forms[0].p_state_name.value = state_name;
document.forms[0].submit();
}
</script>

<script language="javascript">
function lookUpWell(welltype)
{
document.forms[0].well_type.value = welltype;
document.forms[0].submit();
}
</script>
<FORM ACTION="dev_dcd.frame_hidden" METHOD="POST">
<INPUT TYPE="hidden" NAME="p_cntry_name" VALUE="">
<INPUT TYPE="hidden" NAME="p_state_name" VALUE="">
<INPUT TYPE="hidden" NAME="p_county_name" VALUE="">
</FORM>
<script language="javascript">
with( parent.mainFrame )
{
addToList( "No Options", "" );
document.forms[0].p_county_name.length = 0;
addCounty( "No Options", "" );
document.forms[0].p_county_name.selectedIndex = 0;
}
</script>

Any help will be greatly appreciated!

Sep 7 '06 #1
5 22010
VK
DaFallus wrote:
"Error: Object required
Line: 31
Char: 1
Code: 0"

The funny thing is that I ONLY get this error with Internet Explorer.
You get the same kind of error in Firefox either. The reason you don't
see it is that Firefox silently registers JavaScript errors into
JavaScript console (select Tools JavaScript Console and here we are).

Both are complaining on the line
with( parent.mainFrame )
because indeed there is no such object on a stay-alone page (not
uncluded into frameset with a frame named mainFrame).
If this is indeed a frameset, it is necessary to see it in whole.

Sep 7 '06 #2
I'm not exactly sure what you mean. Do I need to use
parent.frames['frame_main'] instead of parent.mainFrame. As I
understand it a "with" statement changes the scope so that you don't
have to write the full path of an object. Like I said, I don't really
know much about JavaScript so if you could offer some more specific
advice I'd really really appreciate it.

Also, I do see now that Firefox is receiving errors, and they are more
detailed than the errors IE is giving me. However, why is it that the
page functions normally in Firefox despite these JavaScript errors and
IE won't let me submit the page?

VK wrote:
DaFallus wrote:
"Error: Object required
Line: 31
Char: 1
Code: 0"

The funny thing is that I ONLY get this error with Internet Explorer.

You get the same kind of error in Firefox either. The reason you don't
see it is that Firefox silently registers JavaScript errors into
JavaScript console (select Tools JavaScript Console and here we are).

Both are complaining on the line
with( parent.mainFrame )
because indeed there is no such object on a stay-alone page (not
uncluded into frameset with a frame named mainFrame).
If this is indeed a frameset, it is necessary to see it in whole.
Sep 7 '06 #3
VK

DaFallus wrote:
I'm not exactly sure what you mean. Do I need to use
parent.frames['frame_main'] instead of parent.mainFrame.
I mean to say that in the posted code you are trying to communicate
with some objects (function, form, form elements) located on another
HTML page - in the frame called "mainFrame". If it is the case then I
need to see the whole frameset structure, thus the page containing
<frameset>
....
</frameset>
definition as well as the content of the page you are trying to
communicate with (the one named "mainFrame")

If you don't have a page with a frameset definition and the originally
posted code supposes to run on a stay-alone page, then your usage of
parent.frames[frameName] construct is wrong and you are thinking of
"parent" and "frame" something what they are not. In this case please
post in full the problematic page (or give a link to it).

Sep 7 '06 #4
If you don't mind, I'd like to email the code to you since all three
pages together is just over 200 lines.

VK wrote:
DaFallus wrote:
I'm not exactly sure what you mean. Do I need to use
parent.frames['frame_main'] instead of parent.mainFrame.

I mean to say that in the posted code you are trying to communicate
with some objects (function, form, form elements) located on another
HTML page - in the frame called "mainFrame". If it is the case then I
need to see the whole frameset structure, thus the page containing
<frameset>
...
</frameset>
definition as well as the content of the page you are trying to
communicate with (the one named "mainFrame")

If you don't have a page with a frameset definition and the originally
posted code supposes to run on a stay-alone page, then your usage of
parent.frames[frameName] construct is wrong and you are thinking of
"parent" and "frame" something what they are not. In this case please
post in full the problematic page (or give a link to it).
Sep 7 '06 #5
VK

DaFallus wrote:
If you don't mind, I'd like to email the code to you since all three
pages together is just over 200 lines.
Go ahead. My address in this group is a real one.

Sep 7 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dave Hammond | last post: by
2 posts views Thread by chuckdfoster | last post: by
7 posts views Thread by dhnriverside | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.