I have the following:
// Purpose: Create destination link.
function updateComp(ContextID, CourseID)
{
var flag = 1;
url = "/CommunityEd/Teachers/frmUpdateComp.cfm?ContextID=" + ContextID + "&CourseID=" + CourseID;
if ((val1 = chkHourlyRate()) != -1)
{
if (val1 != 0)
{
url += val1;
}
}
else
{
flag = -1
}
if ((val2 = chkTotalHours()) -1)
{
if (val2 != 0)
{
url += val2;
}
}
else
{
flag = -1
}
if ((val3 = chkTotalPay()) != -1)
{
if (val3 != 0)
{
url += val3;
}
}
else
{
flag = -1
}
if ((val4 = chkAlternate()) != -1)
{
if (val4 != 0)
{
url += val4;
}
}
else
{
flag = -1
}
if ((val5 = chkAdditional()) != -1)
{
if (val5 != 0)
{
url += val5;
}
}
else
{
flag = -1
}
if (flag != -1)
{
alert(url);
sraWindow=window.open(url); }
}
...
// Somewhere in the main body...
<FORM NAME="frmCRA" ACTION="/CommunityEd/Teachers/actUpdateCRA.cfm" METHOD="POST">
...
<INPUT TYPE="BUTTON" NAME="UpdateCompensation" VALUE="Update Hourly Compensation" onClick="updateComp(38235,4338)">
</FORM>
with the above defined in my web page, the get the following error when I try the click on the button named "UpdateCompensation":
Line: 630
Char: 1
Error: Object expected
Code: 0
URL:
It's expecting an object but I'm only passing two parameters to the javascript function updateComp(ContextID, CourseID). And the function only expect two parameters also. I don't know what's wrong. Can someone help me out concerning this javascript error.
// Purpose: Create destination link.
function updateComp(ContextID, CourseID)
{
var flag = 1;
url = "/CommunityEd/Teachers/frmUpdateComp.cfm?ContextID=" + ContextID + "&CourseID=" + CourseID;
if ((val1 = chkHourlyRate()) != -1)
{
if (val1 != 0)
{
url += val1;
}
}
else
{
flag = -1
}
if ((val2 = chkTotalHours()) -1)
{
if (val2 != 0)
{
url += val2;
}
}
else
{
flag = -1
}
if ((val3 = chkTotalPay()) != -1)
{
if (val3 != 0)
{
url += val3;
}
}
else
{
flag = -1
}
if ((val4 = chkAlternate()) != -1)
{
if (val4 != 0)
{
url += val4;
}
}
else
{
flag = -1
}
if ((val5 = chkAdditional()) != -1)
{
if (val5 != 0)
{
url += val5;
}
}
else
{
flag = -1
}
if (flag != -1)
{
alert(url);
sraWindow=window.open(url); }
}
...
// Somewhere in the main body...
<FORM NAME="frmCRA" ACTION="/CommunityEd/Teachers/actUpdateCRA.cfm" METHOD="POST">
...
<INPUT TYPE="BUTTON" NAME="UpdateCompensation" VALUE="Update Hourly Compensation" onClick="updateComp(38235,4338)">
</FORM>
with the above defined in my web page, the get the following error when I try the click on the button named "UpdateCompensation":
Line: 630
Char: 1
Error: Object expected
Code: 0
URL:
It's expecting an object but I'm only passing two parameters to the javascript function updateComp(ContextID, CourseID). And the function only expect two parameters also. I don't know what's wrong. Can someone help me out concerning this javascript error.