zoukankan
html css js c++ java
javascript验证价格输入
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" language="javascript"> function ckProPrice() { //判断商品价格 var reg = /(^[-+]?[1-9]\d*(\.\d{1,2})?$)|(^[-+]?[0]{1}(\.\d{1,2})?$)/; if ($("#txtProPrice").val() == "") { alert("商品价格不能为空!"); return false; } else { if (!reg.test($("#txtProPrice").val())) { alert("市场价格必须为合法数字(正数,最多两位小数)!"); return false; } else { alert("输入合法!"); return true; } } } $(function () { $("#btnTest").click(function () { ckProPrice(); }); }); </script> 请输入价格: <input type="text" id="txtProPrice" /><input type="button" value="验证输入" id="btnTest" />
查看全文
相关阅读:
第四季-专题20-SPI驱动程序设计
第四季-专题21-USB驱动程序设计
第四季-专题19-I2C驱动程序设计
第四季-专题17-LCD驱动程序设计
第四季-专题18-FLASH驱动程序设计
第四季-专题16-触摸屏驱动程序设计
第四季-专题15-网卡驱动程序设计
第四季-专题14-串口驱动程序设计
python提示AttributeError: 'NoneType' object has no attribute 'append'
python的正则表达式
原文地址:https://www.cnblogs.com/zhangqs008/p/2498385.html
最新文章
makefile 简单介绍
C++ 文件读取
[转载] C++ string, const char*, char* 之间互相转换
python 函数性能分析
AngularJS 指令之 ng-switch
AngularJS 指令之 ng-hide/ng-show
基于Web的企业网和互联网的信息和应用( 1194.22 )
bootstrap3 富文本控件
用Chrome调试NodeJS
node.js 创建第一个web应用
热门文章
ThinkPad E440 Ubuntu 13.1无线网卡 RTL8723BE 驱动解决办法总结
启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!
ThinkPad E440 加内存后导致开不了机
JSTL的test里的逻辑判断不能有空格
Jenkins插件MSTest 不能找到app的问题。
Jenkin注册用户
msbuild ignore project dependencies问题
“System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 错误
监控端主程序
客户端主程序
Copyright © 2011-2022 走看看