且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用于检查文本框是否仅包含整数或数字/数字值的JavaScript

更新时间:2023-11-27 08:40:46

嗨...


你可以使用内置isNaN()方法的javascript ...它返回true,如果它是NotaNumber,否则你会得到一个假...


亲切的问候



嗨...


你可以使用内置isNaN()方法的javascript ...如果是NotaNumber则返回true,否则你得到一个假...


亲切的问候



嗨Gits,


你能不能给一个示例???


问候,

Mathew


ok ...让我们假设以下示例:

展开 | 选择 | Wrap | Line编号跨度>

Hi all,

I would like to get the Javascript code to check the textbox contains only numeric values or numbers..

I am using asp.net and c#.net..

Please help me..

Regards,
Mathew

hi ...

you may use javascript built in isNaN() method for that ... it returns true in case it is NotaNumber else you get a false ...

kind regards


hi ...

you may use javascript built in isNaN() method for that ... it returns true in case it is NotaNumber else you get a false ...

kind regards

Hi Gits,

Can you please give an example for that???

regards,
Mathew


ok ... lets assume following example:

Expand|Select|Wrap|Line Numbers