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 1

Status
Not open for further replies.

tanny

Programmer
Jan 28, 2001
15
AE
Hi guys,

I'm getting an Object expected error on the line I've marked in bold in the following code:

function checkiftoobig(){
var hasbasedata;
var hasothercriteria;
var valuetoreturn;
If ((document.Enquiryform.matrlcod.selectedIndex > 0) || (document.Enquiryform.surfcod.selectedIndex > 0) || (document.Enquiryform.finiscod.selectedIndex > 0) ||(document.Enquiryform.locncod.selectedIndex > 0) ||(document.Enquiryform.elemtype.selectedIndex > 0) )
hasbasedata = "yes";


... Other stuff in here.....
If (hasbasedata == "yes" && hasothercriteria == "no")
alert("You have asked for too much");
valuetoreturn = "notok";
checkiftoobig = valuetoreturn;
}
 
It sounds like you're using IE, which has a terrible debugger for Javascript (I haven't used the add-in one yet). Download a copy of Netscape Communicator 4.7 and run your code on that. To find the error, click on File, Open, and then type javascript: into the location field. Don't forget to put the colon after the word, either. It'll give you a more exact description of the problem and the line it's on.
 
Got the answer!

Javascript is SO case sensitive. Should've been if not If!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top