|
@@ -9,9 +9,24 @@
|
|
|
//$("#name").focus();
|
|
|
$("#inputForm").validate({
|
|
|
submitHandler: function (form) {
|
|
|
- var places = $(".input-xlarge").val();
|
|
|
- if (!(/(^[1-9]\d*$)/.test(places))) {
|
|
|
- alert("售价或采美豆比例应为正整数且不能为0,如100");
|
|
|
+ var places1 = $(".input-xlarge1").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places1))) {
|
|
|
+ alert("套裁1售价应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var places2 = $(".input-xlarge2").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places2))) {
|
|
|
+ alert("套裁2售价应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var places3 = $(".input-xlarge3").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places3))) {
|
|
|
+ alert("套裁3售价应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var places4 = $(".input-xlarge4").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places4))) {
|
|
|
+ alert("美豆比例应为正整数且不能为0,如100");
|
|
|
return false;
|
|
|
}
|
|
|
loading('正在提交,请稍等...');
|
|
@@ -29,7 +44,28 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
-
|
|
|
+ function checkNum(){
|
|
|
+ var places1 = $(".input-xlarge1").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places1))) {
|
|
|
+ alert("套裁1售价应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var places2 = $(".input-xlarge2").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places2))) {
|
|
|
+ alert("套裁2售价应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var places3 = $(".input-xlarge3").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places3))) {
|
|
|
+ alert("套裁3售价应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var places4 = $(".input-xlarge4").val();
|
|
|
+ if (!(/(^[1-9]\d*$)/.test(places4))) {
|
|
|
+ alert("美豆比例应为正整数且不能为0,如100");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -51,26 +87,26 @@
|
|
|
<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>套餐1:</label>
|
|
|
<div class="controls">
|
|
|
12个月超级会员,售价:
|
|
|
- <form:input path="price1" htmlEscape="false" class="input-xlarge" style="width: 60px"/>
|
|
|
+ <form:input path="price1" htmlEscape="false" class="input-xlarge1" style="width: 60px" onblur="checkNum()"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>套餐2:</label>
|
|
|
<div class="controls">
|
|
|
- 3个月超级会员,售价:<form:input path="price2" htmlEscape="false" class="input-xlarge" style="width: 60px"/>
|
|
|
+ 3个月超级会员,售价:<form:input path="price2" htmlEscape="false" class="input-xlarge2" style="width: 60px" onblur="checkNum()"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="control-group">
|
|
|
<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>套餐3:</label>
|
|
|
<div class="controls">
|
|
|
- 1个月超级会员,售价:<form:input path="price3" htmlEscape="false" class="input-xlarge" style="width: 60px"/>
|
|
|
+ 1个月超级会员,售价:<form:input path="price3" htmlEscape="false" class="input-xlarge3" style="width: 60px" onblur="checkNum()"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>采美豆兑换套餐:</label>
|
|
|
<div class="controls">
|
|
|
- 采美豆兑换超会员套餐比例为<form:input path="proportion" htmlEscape="false" class="input-xlarge" style="width: 30px"/>:1
|
|
|
+ 采美豆兑换超会员套餐比例为<form:input path="proportion" htmlEscape="false" class="input-xlarge4" style="width: 30px" onblur="checkNum()"/>:1
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-actions">
|