|
<%@ page language="java" contentType="text/HTML; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script language="JavaScript">
function CheckInputIntFloat(oInput)
{
if(''!= oInput.value.replace(/\d{1,}\.{0,1}\d{0,}/,''))
{
oInput.value = oInput.value.match(/\d{1,}\.{0,1}\d{0,}/) == null ? '' Input.value.match(/\d{1,}\.{0,1}\d{0,}/);
alert('您输入有误!请输入整数或者小数的价格!')
return false;
}
return true;
}
</script>
</head>
<body>
<input type="text" id="input1" name="input1" onkeyup="javascript:CheckInputIntFloat(this);" />
</body>
</html> |
|