日期:2014-11-26 分类:网络技术 浏览:6917 来源:邦明科技
<script type="text/javascript">
function productcheck(){
var priceen=document.productsedit.priceen.value;
var pricech=document.productsedit.pricech.value;
var patrn=/^(([0-9]+[\.]?[0-9]+)|[1-9])$/;
if(pricech=="" || pricech==null){
alert("中文价格不能为空");
document.productsedit.pricech.focus();
return false;
}
if(!patrn.exec(pricech)){
alert("中文价格必须为正数");
document.productsedit.pricech.focus();
&nbasp; return false;
}
if(priceen=="" || priceen==null){
alert("英文价格不能为空");
document.productsedit.priceen.focus();
return false;
}
if(!patrn.exec(priceen)){
alert("英文价格必须为正数");
document.productsedit.priceen.focus();
return false;
}
}
</script>