|
|
|
[
来路:21kn.com 时间:2007-7-7 19:43:34
点击: ] |
|
|
|
|
|
1.用javascript判断 [isNaN()] JS代码: <script language="javascript"> function check(formname){ if (isNaN(formname.price.value)){ alert('请输入数字'); formname.price.focus(); return false; } alert('是数字,通过'); return true; } </script>
调用: <form name="form1" method="post" action="" onsubmit="check(this)"> <input type="text" name="price"> <input type="submit" name="Submit" value="提交"> </form>
2.用VBscript判断[isnumeric()] 跟上面的类似,用isnumeric()函数即可 <script language=vbscript> sub isnum(param) if not isnumeric(param) then msgbox("请输入数字") end if end sub </script> |
|
|
::::站长友情提示:多花一分钟学点什么都好::::
|
|
|
|
|
|
|
|
|
|
|
|
=
= 免责声明 = = |
|
①
欢迎转载我网所刊信息,请注明“来源:E天下网络”。
② 凡本网注明“来源:XXX(非E天下网络)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请在30日内进行。
※联系方式:Airtofly@163.com |
|
|