自动开服,条件验证

master
duhui 2021-08-06 10:34:13 +08:00
parent 23c33ba8d8
commit 83ec6b56c9
1 changed files with 22 additions and 0 deletions

View File

@ -169,6 +169,28 @@
var nums = $("input[name='nums']").val();
var time = $("input[name='time']").val();
var patt = /^[1-9]\d*$/;
if (state == 1){
if (choose == null){
alert("必须选择类型!");
return;
}
var test = patt.test(nums);
if (choose == 1) {
if (nums == null || nums == "" || test != true) {
alert("注册人数必填,必须为正整数!");
return;
}
}
if (choose == 2){
if (time == null || time == ""){
alert("时间必填!");
return;
}
}
}
$.ajax({
type: "POST",
data: