numeric value?

M

Mikael Hellström

Hi,
I'm looking for a "built in function" to check if a value is
a numeric value. Is there a function like this in Java script...?
Regards Mikael
 
H

Hywel Jenkins

Hi,
I'm looking for a "built in function" to check if a value is
a numeric value. Is there a function like this in Java script...?

Yes. Did you try comp.lang.javascript?

isNaN()
 
M

Mikael Hellström

Well...
I try to do this...

else if ( (form.pristextfield.value!= "") &&
IsNaN(form.pristextfield.value)==false )
{
alert('priset måste vara ett heltal!');
form.pristextfield.focus();
return false;
}

i get a error message

Regards mikael
 
H

Hywel Jenkins

Well...
I try to do this...

else if ( (form.pristextfield.value!= "") &&
IsNaN(form.pristextfield.value)==false )
{
alert('priset måste vara ett heltal!');
form.pristextfield.focus();
return false;
}

i get a error message

What's the URL with this code? If what you've posted here is excactly
what you've got the error is obvious: your first line has "else if" -
what's before that?

Perhaps telling us the error would have helped. Besides, it's isNaN not
IsNaN, isn't it? This page may be of help:
http://www.allmyfaqs.com/faq.pl?How_to_post
 

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
474,082
Messages
2,570,589
Members
47,211
Latest member
Shamestone

Latest Threads

Top