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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP

Status
Not open for further replies.

khue

Programmer
Joined
Mar 6, 2001
Messages
112
Location
US
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=&quot;frmCRA&quot; ACTION=&quot;/CommunityEd/Teachers/actUpdateCRA.cfm&quot; METHOD=&quot;POST&quot;>

...

<INPUT TYPE=&quot;BUTTON&quot; NAME=&quot;UpdateCompensation&quot; VALUE=&quot;Update Hourly Compensation&quot; onClick=&quot;updateComp(38235,4338)&quot;>
</FORM>


with the above defined in my web page, the get the following error when I try the click on the button named &quot;UpdateCompensation&quot;:

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top