HighDots Forums  

"function" is not defined - error

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss "function" is not defined - error in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
aspruyt@hotmail.co.uk
 
Posts: n/a

Default "function" is not defined - error - 05-30-2006 , 12:15 PM






Hi,

I've been sitting for a few hours now with a bug and can't seem to get
a fix for. It is for an existing site that is being fixed temporarily
and then going to be redeveloped in a few months.

My problem:

I am sitting with a form consisting of a drop downbox that fires a
javascript on the onChange event. The drop down box is populated out of
a database and the links are also built up from the database entries
that are selected.

I keep getting the same error message no matter what I try. Very
similar code is used in another page and there it works fine.

here's the link to the working page

http://www.liberty-ermitage.com/test...7&code=history

and this is the one that keeps giving errors

http://www.liberty-ermitage.com/test...87&tab=1&fund=

Due to legislation US citizens wont be able to follow those links
though.

Error message:
Mozilla Firefox 1.5.0.3 javascript console error msg: "goThere is not
defined"

Code:

in <head> section:
<script language="JavaScript" type="text/javascript">
.....
function goThere_1()
{
if(!document.theForm_1.theMenu_1.selectedIndex=="" )
{
window.open(document.theForm_1.theMenu_1.options[document.theForm_1.theMenu_1.selectedIndex].value,"_self","");
}
}
</script>

in the <body> section:

<form name="theForm_1" id="theForm_1">
<select name="theMenu_1" class="tahoma_"
style="font-size:10px" onChange="goThere_1()" id="theMenu_1">
<option selected value="">Related Funds:--
<%
drs3.movefirst
do until drs3.eof
dim strVar
dim strNew
strVar=trim(drs3("CURRENCY"))

select case strVar
case "USD"
strNew = "($)"
case "GBP"
strNew = "(£)"
case "EUR"
strNew = "(€)"
case "JPY"
strNew = "(&yen"
case Else
strNew = "(" & strVar & ")"
end select

Response.Write "<OPTION value=""prices_drill.asp?catID=" & _
drs3("CODE") & "&code=" & code & """>" & drs3("WebFundName") & " "
& strNew
drs3.movenext
loop
%>
<% End If %>
</SELECT>
</form>


Reply With Quote
  #2  
Old   
Stephen Chalmers
 
Posts: n/a

Default Re: "function" is not defined - error - 05-30-2006 , 09:30 PM







aspruyt (AT) hotmail (DOT) co.uk wrote:
Quote:
Hi,

I've been sitting for a few hours now with a bug and can't seem to get
a fix for. It is for an existing site that is being fixed temporarily
and then going to be redeveloped in a few months.

My problem:

I am sitting with a form consisting of a drop downbox that fires a
javascript on the onChange event. The drop down box is populated out of
a database and the links are also built up from the database entries
that are selected.

I keep getting the same error message no matter what I try. Very
similar code is used in another page and there it works fine.

here's the link to the working page

http://www.liberty-ermitage.com/test...7&code=history

and this is the one that keeps giving errors

http://www.liberty-ermitage.com/test...87&tab=1&fund=
The errors indicated refer to the repeated syntax error: If(...)
instead of if(...)
Try fixing that first.



Reply With Quote
  #3  
Old   
Anthony
 
Posts: n/a

Default Re: "function" is not defined - error - 05-31-2006 , 03:50 AM




Stephen Chalmers wrote:
Quote:
aspruyt (AT) hotmail (DOT) co.uk wrote:
Hi,

I've been sitting for a few hours now with a bug and can't seem to get
a fix for. It is for an existing site that is being fixed temporarily
and then going to be redeveloped in a few months.

My problem:

I am sitting with a form consisting of a drop downbox that fires a
javascript on the onChange event. The drop down box is populated out of
a database and the links are also built up from the database entries
that are selected.

I keep getting the same error message no matter what I try. Very
similar code is used in another page and there it works fine.

here's the link to the working page

http://www.liberty-ermitage.com/test...7&code=history

and this is the one that keeps giving errors

http://www.liberty-ermitage.com/test...87&tab=1&fund=

The errors indicated refer to the repeated syntax error: If(...)
instead of if(...)
Try fixing that first.

Hi Stephen

Thanks a lot that did it /doh. Sometimes I stare myself blind in
frustration and miss the obvious. It was just the syntax errors. What I
find extremely wierd is that the other page contains the same syntax
errors (upper-case "I" in "if"s) but it runs...

Anyway thanks again
Anthony



Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.