I get an "Error: Object expected" and I don't know why

Giganews Newsgroups
Subject: I get an "Error: Object expected" and I don't know why
Posted by:  dan_fernand…@pacbell.net (Danny)
Date: 18 Jul 2003

Hi I don't understand why I keep getting "Error: Object expected" I
tried different things and haven't been able to solve it. I'm a newbie
so I'm not sure what I'm doing wrong. The debugger breaks at the
<BODY> Tag of my code so I'm thinking the problem is with my
InitPage() function. I appreciate the advice. Here is my code.

<SCRIPT LANGUAGE="Javascript">
<!--

var flag = false;

function InitPage()
{
    
    document.MyForm.Datebox.value = getCurrentDate();
}

function MyForm_onsubmit()
{

  // Check Date Open Box
  if ( checkDate(document.MyForm.Datebox.value) == false )
  {        alert("You must provide a Date")
        return false;
  }
}

// -->
</SCRIPT>

<HTML>
<HEAD>
<TITLE>Dummy Title </Title>
</HEAD>
<BODY onload="InitPage();" bgColor=#0a357e text=White Link=White
vLink=White aLink=White>
<form name = "MyForm" method="post" action="addIssue.asp"
      onsubmit= "return MyForm_onsubmit()" >

  Date Opened <input name="Datebox">&nbsp;Format: dd/mm/YYYY &nbsp;
  <input type="submit" value="Save Details" name="Save_Button">&nbsp;
  <input type="reset" value="Clear Details" name="Clear_Button">
</form>
</BODY>
</HTML>

Replies