Current location: Hot Scripts Forums » General Web Coding » JavaScript » Object Expected


Object Expected

Reply
  #1 (permalink)  
Old 01-18-05, 03:18 PM
The Omega The Omega is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Object Expected

Getting an object expected error on this script

Code:
'Temp Variable Declarations
MenloExFSC = "0.03"
CurrentFSC = "0.07
%>
<script language="text/javascript" >
function Customer_FSC()
{
	if (document.dispatchform.frmDispatchCustomer.value = "Menlo") {
		document.dispatchform.frmDispatchRateFSCRate.value = "<% Response.write MenloExFSC %>";
	}
	else
	{
		document.dispatchform.frmDispatchRateFSCRate.value = "<% Response.write CurrentFSC %>";
	}
}
</script>
<%
the line in the form is (ASP/VBscript)
PHP Code:

"Customer: <span class=""accesskey"">(Alt + C)</span><br><div align=""center""><input SIZE=""15"" name=""frmDispatchCustomer"" value=""" DispatchCustomer """ maxlength=""25"" accesskey=""C"" onKeyDown=""if(event.keyCode==13) {event.keyCode=9; Customer_FSC();}""></div>" vbNewLine 
Reply With Quote
  #2 (permalink)  
Old 01-18-05, 04:47 PM
The Omega The Omega is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by The Omega
[code]
CurrentFSC = "0.07"
Corrected a copy error....
Reply With Quote
  #3 (permalink)  
Old 01-19-05, 12:29 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
It's not easy to know where the error is because you haven't marked which line the error occurrs on or the whole code so I can test it.
Object expected errors usually mean you have made a reference error or mistyped something.
Btw, you have used double "s in the line from the form. This will most likely confuse the browser. I suggest you do it this way:
Code:
"Customer: <span class='accesskey'>(Alt + C)</span><br><div align='center'><input SIZE='15' name='frmDispatchCustomer' value='" & DispatchCustomer & "' maxlength='25' accesskey='C' onKeyDown='if(event.keyCode==13) {event.keyCode=9; Customer_FSC();}'></div>"
Also, you try to set the keyCode in the event object, I think this value is read-only (would make sense).
Reply With Quote
  #4 (permalink)  
Old 01-20-05, 02:04 PM
The Omega The Omega is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I actually figured out why it wasnt working... the script tag should have been
Code:
<script language="javascript">
as for the double quotes.... in ASP/vbscript, those are needed to separate the code and variables....
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question dealing with object arrays dmiranda Everything Java 2 01-09-05 04:15 AM
null or not an object ccgorman JavaScript 2 10-27-04 06:59 AM
'menus[...]' is null or not an object kepin JavaScript 1 08-16-04 04:46 PM
javascript object hidden by flash object morlack JavaScript 1 03-09-04 05:36 AM
excel object permissions msrnivas ASP.NET 1 12-18-03 01:02 PM


All times are GMT -5. The time now is 10:41 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.