Checking if your data is digit

You can use Javascript to detect the content of the input box is digit or not.

Here is the code you can use:

if ( (yourcontent+"").match(/^\d+$/) ) {
   //it's all digits
}

 

Revisions

No comments yet.

Leave a Reply