Forum Moderators: open
So, if anyone can help me, I'd appreciate it. It's the *weirdest* things tossing out the errors, too.
The errors are:
1) Line 124 Char 33 Object doesn't support property or method Code 0
2) Line 27 Char 7 Object doesn't support property or method Code 0
And yes, it shows the errors in this order - which I thought was also odd, since the error further down the page shows up first.
The javascript:
function dosubmit() {
document.form1.Email.value = document.form0.Email.value;
savecookie(document.form1.Email.value);
document.form1.action = 'CLogin.dll?RegCustLogin';
document.form1.submit();
return false;
}
function loadcookie() {
var emailstr = "";
if( document.cookie!= "" ) {
cookArray = document.cookie.split(";");
for( i = 0; i < 4; i++ ) {
if( cookArray[i]!= null && cookArray[i]!= "") {
cookname = cookArray[i].split("=")[0];
if( cookname.indexOf("custlogin") >= 0 )
emailstr = cookArray[i].split("=")[1];
}
}
}
if( emailstr!= "" ) {
document.form0.Email.value = emailstr;
document.form1.Password.focus();
}
// This is Line 27, the letter "o" in "document" is character 7 //
else document.form0.Email.focus();
return false;
}
function savecookie(emailval) {
var expireDate = new Date;
var nYear = expireDate.getYear()+1;
if( nYear < 2000 ) nYear = 2000;
expireDate.setYear(nYear);
document.cookie = "custlogin=" + emailval + ";expires=" + expireDate.toGMTString();
return false;
}
function newcust() {
theform = document.form1;
document.location = 'clogin.dll?reg2?projectid=' + theform.inprojectid.value + '&displaytype=1' + '&runtimekey=' + theform.runkey.value;
return false;
}
The form:
<form name="form0" method="post" action="javascript:document.form1.Password.focus()">
</td></tr>
<tr><td width="125" style="text-align:right;">
<b>Email:</b>
</td><td>
<input class="form" type="text" size="25" name="Email" value="" />
<form name="form1" method="post" action="javascript:dosubmit()" />
<input type="hidden" name="inprojectid" value="13" />
<input type="hidden" name="runkey" value="" />
<input type="hidden" name="Email" value="" />
</td></tr>
<tr><td style="text-align:right;">
<b>Password:</b>
</td><td>
<input class="form" type="password" size="25" maxlength="20" name="Password" />
<input type="hidden" name="projectid" value="13" />
<script type="text/javascript">
//This is Line 124. Character 33 is the letter "t" in "document" //
if(document.form0.Email) document.form0.Email.focus();
</script>
<input type="hidden" name="Sendmail" value="0" />
</form>
</td></tr>
<tr><td colspan="2">
<input class="form" type="submit" value="Submit" onclick="dosubmit(); return false;" />
</form>
<script type="text/javascript">loadcookie();</script>
Now what's *really* odd is that I tried everything I could think of to get rid of these errors. At one point, I even erased the whole "function loadCookie()" section (which contains the Line 27 error) - and it returned the *exact* same error - even though the line was completely gone! How is that even possible? (And yes, I double-checked to be sure I saved and uploaded the file - still did it)
Can anyone take a glance and see what's up with this? I'd really appreciate the help :)
I haven't gone through and checked the old designer's form code - I've just been trying to get the javascript to stop popping up the error messages.
Basically, I just copied exactly what the old designer had, I just put what script inof she had within *my* tables (as hers were *way* weird).
I'll fix the form tag issues and see what happens - I never even noticed that...just copied and pasted!
As for counting from the wrong starting point, I'd thought that, too. But when I changed starting points, or deleted lines to see if the error message would bring it up a bit to change the line number, it always pointed to those two spots, every time.
I'm not too worried about it - I'm sure something'll get figured out. But it'd be nice to know why it's doing this - I have another script that's throwing out an odd error - it'll go away only if I remove the "a" from my <a href=" tag. Makes the script error go away, but renders the link useless.