Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript: Object Expected
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

The Omega
New Member

55 Posts

Posted - 18 January 2005 :  16:52:41  Show Profile
Getting an object expected error on this script


'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)

"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 & _

Edited by - The Omega on 18 January 2005 17:51:22

dayve
Forum Moderator

USA
5820 Posts

Posted - 18 January 2005 :  17:14:57  Show Profile  Visit dayve's Homepage
CurrentFSC = "0.07

is missing the end quote, it should look like this:

CurrentFSC = "0.07"

you're missing an equal symbol here:

if (document.dispatchform.frmDispatchCustomer.value = "Menlo") {

it should be:

if (document.dispatchform.frmDispatchCustomer.value == "Menlo") {

as for the declared variable:

"<% Response.write MenloExFSC %>";

I would change to:

"<%=MenloExFSC %>";

I would do the same thing as above with CurrentFSC. Actually I would not even use VBScript to declare your static variables, just declare them in the javascript instead.


<script language="text/javascript" >
function Customer_FSC()
{
var MenloExFSC = '0.03';
var CurrentFSC = '0.07';

	if (document.dispatchform.frmDispatchCustomer.value == "Menlo") {
		document.dispatchform.frmDispatchRateFSCRate.value = MenoloExFSC;
	}
	else
	{
		document.dispatchform.frmDispatchRateFSCRate.value = CurrentFSC;
	}
}
</script>


Still looking at the rest.


Edited by - dayve on 18 January 2005 17:21:26
Go to Top of Page

The Omega
New Member

55 Posts

Posted - 18 January 2005 :  17:48:17  Show Profile
the reason they are declared in vbscript is because as soon as I get it working, they will become db values.... I guess I could declare them as vbscript values and then port them into javascript and redeclare them..... as for the missing " on CurrentFSC, it was a copy error....

I will try the others and see what gives thanks....
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07