Script to check every character

Write a code to get the text box data and to check each and every char?

Questions by karthikeyanakka

Showing Answers 1 - 6 of 6 Answers

vasanth.kvj

  • Nov 23rd, 2009
 

function numvalid(a)
 {
  var numStr="1234567890";
var thisChar;
var counter=0;
for(var i=0; i < a.length; i++)
{
thisChar=a.substring(i,i+1);
if(numStr.indexOf(thisChar)!=-1)
{counter++;}
}
if(counter==(a.length))
{return true;}
else
{
alert("Enter valid  Number");
document.reg_form.no.value="";
}
 
  }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions