Commit b082a042 by libin

时空伴任务添加标识号验证功能

parent 43d8a85d
......@@ -91,7 +91,7 @@
<input type="text" id="objectValue" name="objectValue" class="easyui-textbox" style="height:26px;" data-options="required:true" value="${objectValue}"/>
</c:if>
<c:if test="${flag eq 'skbs'}">
<input type="text" id="objectValue" name="objectValue" class="easyui-textbox" style="height:26px;" data-options="required:true"/>
<input type="text" id="objectValue" name="objectValue" class="easyui-textbox" style="height:26px;" />
</c:if>
</span>
</td>
......@@ -155,10 +155,46 @@
<script type="text/javascript" src="/common/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="/common/datepicker/calendar.js"></script>
<script>
//onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'datepicker1\')}',maxDate:'#F{\'%y-%M-%d 23:59:59\'}'})"
$.extend($.fn.validatebox.defaults.rules, {
mobile: {
validator : function(value) {
return /(^[1][3|5|7|8|9]{1}\d{9}$)/.test(value);
},
message : "请输入正确的手机号码"
},
IMEI: {
validator: function (value) {
var re=/^([A-Za-z0-9]{15})$/;
return re.test(value);
},
message: "输入正确的(15位数字(英文字母))IMEI号!"
},
imsi: {
validator: function (value) {
var re=/^([0-9]{15})$/;
return re.test(value);
},
message: "输入正确的(15位数字)IMSI号!"
},
OTHERNUM: {
validator: function (value) {
var flag=value!=null && value !='';
return flag;
},
message: "输入正确的标识号!"
}
});
$(document).ready(function() {
document.getElementById("datepicker1").value = today();
initLimitTime();
$("#objectType").combobox({
onSelect:function(record){
var type=record.value;
initValidateRules(type);
}
});
initValidateRules("4314");
});
function today(){
var today=new Date();
......@@ -269,10 +305,34 @@
$("#datepicker2").val("");
}
}
function validateNum(num,type){
if(""==type){
function initValidateRules(type){
$("#objectValue").validatebox();
if("3996"==type){
$("#objectValue").textbox({
required: true,
validType: 'mobile'
});
}
if("4314"==type){
$("#objectValue").textbox({
required: true,
validType: 'imsi'
});
}
if("4315"==type){
$("#objectValue").textbox({
required: true,
validType: 'IMEI'
});
}
if("4615"==type||"558"==type){
$("#objectValue").textbox({
required: true,
validType: 'OTHERNUM'
});
}
$("#objectValue").textbox("validate");
}
</script>
<script type="text/javascript" src="/js/bsrwInsert.js"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment