页面输入框禁止粘贴事件

 

<INPUT onblur="Currency.blur(this);" style="IME-MODE: disabled" ondragenter="return false" id=price class=currency onfocus=Currency.focus(this);

onkeypress="return event.keyCode>=48&amp;&amp;event.keyCode<=57||event.keyCode==46" onpaste="return !clipboardData.getData('text').match(/\D/)" name=price maxLength=12 required="1"

label="单价(元)" dataprecision="20" datatype="number" dataScale="2" />

 

 

 

js 日期运算,在一个日期上加3个月

 

   var PrjectGtherReportForm={

 filter:function(){

 var complainDateStart = $('complainDateStart');

 var complainDateEnd = $('complainDateEnd');

 if(complainDateEnd.value<complainDateStart.value){

 alert("起始时间不能大于结束时间!");return false;

 }

 var arrOne = complainDateStart.value.split("-");

 var arrTwo = complainDateEnd.value.split("-");

     var dateOne = new Date(parseInt(arrOne[0]),PrjectGtherReportForm.handleStr(arrOne[1])+3,PrjectGtherReportForm.handleStr(arrOne[2]));

        var dateTwo = new Date(parseInt(arrTwo[0]),PrjectGtherReportForm.handleStr(arrTwo[1]),PrjectGtherReportForm.handleStr(arrTwo[2]));

        if(dateTwo.getTime()>dateOne.getTime()){

        alert("查询时间范围最大为三个月!");

        return false;

        }

 

 return false;

 },

 validate:function(form){

LogicForm.pushFilter("myfileter",this.filter,true);

return LogicForm.validate(form);

 },

 handleStr:function(inputStr){

 if(inputStr.length==2){

 if(inputStr.substring(0,1)=='0'){

 return parseInt(inputStr.substring(1,2));

 }else{

 return parseInt(inputStr);

 }

 }else{

 return 1;

 }

 }

 

 };

你可能感兴趣的:(事件)