1
   

A query about NAN() method of javascript

 
 
Reply Tue 11 Oct, 2011 09:50 am
I am using NAN() method to test whether a user is entering a numeric value of not.It is working fine when a user is not entering a numeric value.Suppose he/she enter "abc" instead of a numeric value then it is showing a error message but he/she change the value to a numeric number still it is giving a same error message even after refreshing a page.
What could be the error?
How to fix it?

Below is the code.


<script type="text/javascript" >
function validate()
{
var tos=document.getElementById('tos').value;
var df=document.getElementById('df').value;
if(df=="")
{
alert("Please enter the value of Df");
return false;
}
if (isNaN(df.value))
{
alert('Please enter a numberic value of Df');
return false;
}
}
</script>


Thanks in advance
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 1 • Views: 1,050 • Replies: 0
No top replies

 
 

 
  1. Forums
  2. » A query about NAN() method of javascript
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/05/2024 at 05:15:23