Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object expected 1

Status
Not open for further replies.

InnoTech

ISP
Jan 2, 2003
612
0
0
US
hey guys. i've been a tek-tips member for a while but never came to the frontpage forum til now. please help.

first off i don't know html well at all. i'm rebuilding our website (i'm an ISP) and am comeing accross in an error after clicking the submit button on a login form on the homepage pointing to our mail server. it will login ok but only after it gives the error:

"an error has occurred in the script on this page"
line:180
char:1
error: Object expected
code: 0
url: file://C:\WINDOWS\Temporary Internet Files\Content.IE5\69N8HC3E\[1].htm

this is the error in MS frontpage when i test it. the line 180 is a blank line. if more info is needed and/or you want me to paste some of the script just let me know.

BTW in IE it will log you in after an error pops up saying "object expected" and something about "do you want to debug?"

thanks everyone.

"Jack of all trades. Master of none."
[americanflag]
 
Sounds like a JavaScript error. Are you linking in any external js files?

If the page is short, you might post the code for it.
 
the page is pretty damn large but i'll post the form if that will help and yes it is a JS error I forgot to mention that part when you try logging in with IE thats what it says. also, i know this sounds very stupid but i don't know if i'm linking external js files or not. sorry.

</table>
<!--left text-->
</TD>
<TD WIDTH=376 HEIGHT=550 COLSPAN=5 valign=&quot;top&quot; bgcolor=&quot;F6F6F6&quot;>

<!--center text-->

<div class=&quot;text&quot; style=&quot;font-family:Verdana; padding-right:30; font-size:10px&quot; >
<img src=&quot;images/c1.jpg&quot; width=&quot;372&quot; height=&quot;27&quot;>&nbsp;<br>

&nbsp;<form action=&quot; method=&quot;post&quot; name=&quot;implogin&quot;>
<p>&nbsp;</p>

<table align=&quot;left&quot; border=&quot;0&quot; width=&quot;193&quot; height=&quot;12&quot;>
<tr><td align=&quot;left&quot; colspan=&quot;2&quot; class=&quot;header&quot; height=&quot;18&quot; width=&quot;174&quot;>
<b><font face=&quot;Verdana&quot;><font size=&quot;2&quot; color=&quot;#6F7B8C&quot;>lake country</font><font color=&quot;#0808A0&quot; size=&quot;2&quot;>webmail</font></font></b></td></tr>
<tr>
<td align=&quot;left&quot; class=&quot;light&quot; height=&quot;22&quot; width=&quot;64&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#888488&quot; size=&quot;1&quot;>Username:</font></b></td>
<td align=&quot;left&quot; height=&quot;22&quot; width=&quot;119&quot;>
<input type=&quot;text&quot; tabindex=&quot;1&quot; name=&quot;imapuser&quot; value=&quot;&quot; size=&quot;14&quot; /></td>
</tr>
<tr>
<td align=&quot;right&quot; class=&quot;light&quot; height=&quot;22&quot; width=&quot;64&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#909090&quot; size=&quot;1&quot;>Password:</font></b></td>
<td align=&quot;left&quot; height=&quot;22&quot; width=&quot;119&quot;>
<input type=&quot;password&quot; tabindex=&quot;2&quot; name=&quot;pass&quot; size=&quot;14&quot; /></td>
</tr>

<tr>
<td height=&quot;1&quot; width=&quot;64&quot;>
<input type=&quot;hidden&quot; name=&quot;server&quot; value=&quot;webmail.lcii.net&quot; />
<input type=&quot;hidden&quot; name=&quot;port&quot; value=&quot;143&quot; />
<input type=&quot;hidden&quot; name=&quot;namespace&quot; value=&quot;&quot; />
<input type=&quot;hidden&quot; name=&quot;maildomain&quot; value=&quot;lcii.net&quot; />
<input type=&quot;hidden&quot; name=&quot;protocol&quot; value=&quot;imap/notls&quot; />
<input type=&quot;hidden&quot; name=&quot;realm&quot; value=&quot;lcii.net&quot; />
</td>

<td height=&quot;1&quot; width=&quot;119&quot;><input type=&quot;hidden&quot; name=&quot;folders&quot; value=&quot;webmail.****.net&quot; /></td>
</tr>

<tr>
<td align=&quot;right&quot; class=&quot;light&quot; height=&quot;33&quot; width=&quot;64&quot;><input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;button&quot; tabindex=&quot;4&quot; value=&quot;Get Mail&quot; onclick=&quot;return submit_login();&quot;/></td>
<td align=&quot;left&quot; class=&quot;light&quot; height=&quot;33&quot; width=&quot;119&quot;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img border=&quot;1&quot; src=&quot;../../../newsite1/images/horde-power1.png&quot; width=&quot;67&quot; height=&quot;26&quot;></td>
</tr>

<tr>
<td height=&quot;1&quot; width=&quot;64&quot;></td>
<td align=&quot;left&quot; class=&quot;light&quot; height=&quot;1&quot; width=&quot;119&quot;>&nbsp;</td>
</tr>

</table>
</form> <p>

<br><br><br>
</p>
<div align=&quot;left&quot; style=&quot;padding-right:30&quot;>
&nbsp;</div>
</div>
remember the line that has the error is the last line posted and it is blank!

&quot;Jack of all trades. Master of none.&quot;
[americanflag]
 
Where is the code for &quot;submit_login()&quot;?

If you're linking in a javascript file, it would most likely be in the <head> section and look something like this:

<script language=&quot;JavaScript&quot; src=&quot;../script.js&quot;></script>

If you're not linking in the script, &quot;submit_login()&quot; has to be somewhere in the HTML code for the page. It will reside within a <script> tag.

If you cannot find any code for this, then I would suggest that that is your problem. The &quot;object&quot; that is missing is &quot;submit_login()&quot;

Post any further problems...
Hope this helps.
 
ok thanks that helps. let me stumble around in it and see what i find. again, thanks!


&quot;Jack of all trades. Master of none.&quot;
[americanflag]
 
oh, this was indeed in my other post:
onclick=&quot;return submit_login();&quot;
is that one of the things you were asking about?

&quot;Jack of all trades. Master of none.&quot;
[americanflag]
 
Yes.

That is the only reference I see to anything JavaScript related in the code you provided.

I would imagine, since when attempting to submit your form, the *return* value of that method is used, it is a validation script that returns false (form will not be submitted) if an error is found, and returns true (form will be submitted) otherewise.

Since you said this error only occurs when you try to submit the form, and since &quot;submit_login()&quot; is the only JavaScript thing happening in relation to that event, the abscence of the method is my first guess. If you find the code for the &quot;submit_login()&quot; method, post it. The missing object will be found in there.

 
when you said &quot; If you find the code for the &quot;submit_login()&quot; method, post it.&quot; are you meaning something more than the first post of script in which does have:

onclick=&quot;return submit_login();&quot;

its about 3/4 the way down. or are you talking about something else?


&quot;Jack of all trades. Master of none.&quot;
[americanflag]
 
Post what's between <script> </script> in the section you've found.

Or what's in the brackets ('{') for the submit_login() function.

Should look something like this:
function submit_login()
{
yada yada
}
 
i would like to thank you very much i was doing some stupid stuff. here is what i added in the <head> tags:

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
<!--

function setFocus()
{
document.implogin.imapuser.focus();
}

function submit_login()
{
if (document.implogin.imapuser.value == &quot;&quot;) {
alert('Please provide your username and password');
document.implogin.imapuser.focus();
return false;
} else if (document.implogin.pass.value == &quot;&quot;) {
alert('Please provide your username and password');
document.implogin.pass.focus();
return false;
} else {
return true;
}
}
//-->
</script>

<script language=&quot;JavaScript1.2&quot; type=&quot;text/javascript&quot;>
<!--
function enter_key_trap(e)
{
var keyPressed;

if (document.layers) {
keyPressed = String.fromCharCode(e.which);
} else if (document.all) {
keyPressed = String.fromCharCode(window.event.keyCode);
} else if (document.getElementById) {
keyPressed = String.fromCharCode(e.keyCode);
}

if ((keyPressed == &quot;\r&quot; || keyPressed == &quot;\n&quot;) && (submit_login())) {
document.implogin.submit();
}
}
//-->
</script>


look better? ;-)

thanks again.

&quot;Jack of all trades. Master of none.&quot;
[americanflag]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top