var value = $("#" + me.id + "-editAttrList .fieldValue:eq(" + index + ")").val(); if (value !== "") { // 根据类别检查 var r = ""; var type = fieldName.fieldType; switch (type) { case "INT": r = /^d+$/; isOk = r.test(value); break; case "DOUBLE": r = /^(([1-9][0-9]*.[0-9][0-9]*)|([0].[0-9][0-9]*)|([1-9][0-9]*)|([0]{1}))$/; isOk = r.test(value); break; case "DATE": r = /^d{4}(-|/|.)d{1,2}1d{1,2}$/; isOk = r.test(value); break; case "STRING": break; }; }