Type Mismatch Error

R

RICHARD BROMBERG

Can anyone tell me why I am getting the following VBScript runtime error


Microsoft VBScript runtime error '800a000d'
Type mismatch: 'fVALIDATEEMAIL'
/JAVASCRIPT/VALIDATEEMAIL.asp, line 31

Here is the code snippet that calls the fVALIDATEEMAIL function.
Here is Line 31 answer=fVALIDATEEMAIL("(e-mail address removed)") .
The complete snippet is shown below

<%
dim email
dim answer
if Request.Querystring("isSubmitted") = "yes" then
email=request.querystring("EMAILADDRESS")
response.write("this is your email address " + "'" + email + "'")
answer=fVALIDATEEMAIL("(e-mail address removed)")
end if
%>


The actual function is part of an external .JS file. All the other functions
work fine.


function fVALIDATEEMAIL("a")
{
fVALIDATEEMAIL="yes"
end function
}
 
R

Randy Webb

RICHARD BROMBERG said the following on 6/23/2007 1:14 PM:
Can anyone tell me why I am getting the following VBScript runtime error

If you can tell anybody what VBScript has to do with Javascript.
The actual function is part of an external .JS file. All the other
functions work fine.

What makes you think that VBScript is going to execute in a Javascript File?
function fVALIDATEEMAIL("a")
{
fVALIDATEEMAIL="yes"
end function
}

"end function" is invalid JS and as such will throw an error.
 
R

RICHARD BROMBERG

Randy

I removed the "end function" but the error persists.

Is it necessary for either the function (or the Dim statement which defines
the arguement to be passes ) to define a data type ?

dick
 
L

Lee

RICHARD BROMBERG said:
Randy

I removed the "end function" but the error persists.

Is it necessary for either the function (or the Dim statement which defines
the arguement to be passes ) to define a data type ?

When replying to a post in this newsgroup, please put your
new text *after* the text you're responding to.

Are you writing VBScript or Javascript?
There is no Dim statement in Javascript.

You should check the resources mentioned in this newsgroup's
FAQ for tutorials or books from which you might learn some
basic Javascript syntax.

The only two lines of:

that are reasonable Javascript are the lines that contain only
curly braces.

One valid way to write a function named fVALIDATEEMAIL that
returns the string "yes" would be:

function fVALIDATEEMAIL()
{
return "yes";
}


--
 
R

Randy Webb

RICHARD BROMBERG said the following on 6/23/2007 5:36 PM:

Please here top-post don't , upon frowned is it.
I removed the "end function" but the error persists.

Is it necessary for either the function (or the Dim statement which
defines the arguement to be passes ) to define a data type ?

Why do you think VBScript is going to execute in a JScript block? It
won't. Try removing the VBScript entirely and see if your error
persists. If it does, then post a URL to a sample page that shows the
code and error. My first sentence is a reference to your top posting and
was done intentionally.
 
R

RICHARD BROMBERG

What is topposting?
I am kind of new at this, so please excuse the fact that some of my
questions sound naive


I am using JavaScript in an htm..
 
R

RICHARD BROMBERG

Perhaps I should have been a little clearer .

I am trying to pass a string to the function and inside the function test
the string and return "yes" or "no" depending on the passed string.
 
L

Lee

RICHARD BROMBERG said:
Perhaps I should have been a little clearer .

I am trying to pass a string to the function and inside the function test
the string and return "yes" or "no" depending on the passed string.

Top-posting is when you insist on typing your new text at the
beginning of the message, instead of after the text you're quoting.

And, again, you should learn the basics of Javascript before you
start trying to guess how to write functions.

function yesOrNo(str) {
if ( str == "something" ) {
return "yes";
} else {
return "no";
}
}

You do understand the difference between "yes" and true, don't you?


--
 
L

-Lost

What is topposting?
I am kind of new at this, so please excuse the fact that some of my
questions sound naive

You don't quote signatures, and you bottom-post (as opposed to top-posting).

See how I pasted your response to the *bottom*? Then I respond under
that? It enables everyone to read from the top, down. Instead of
bottom to the top, or back and forth like most idiots do.
I am using JavaScript in an htm..

Um, you need to reread all of Randy's posts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top