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" error with Body.Onload 1

Status
Not open for further replies.

hsp7777

Programmer
Jan 11, 2005
67
US
Greetings,

I have a "newbie" question in relation to the following code below. I am simply trying to call a JavaScript function (and pass the following argument) when the "body onload" event occurs. I am receiving an "Object Expected" error instead. Any ideas as to what I am doing wrong?

<body onload = "Check_Status(document.all.ddlBranchStatusID);">

Thanks in advance!
 
it could mean that the function Check_Status is not found, or any of the objects in the chain document.all.ddlBranchStatusID are not found.

also, the document.all collection is IE only. for cross-browser compatibility you should use DOM methods, e.g.

Check_Status(document.getElementById('ddlBranchStatusID'))



-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Thanks. I discovered that it was due to a semi-colon after the function header. Sometimes it's the little things, huh?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top