event.srcElement.focus(); //在触发事件的元素上设置焦点
event.srcElement.select(); //选中触发事件的元素值
setTimeout("__HAVEERROR = false",10);  //隔10毫秒后设置__HAVEERROR为false 
event.cancelBubble = true;  //取消事件向父级元素传递
event.keyCode = '0';  //刷新
return false;         //返回false

解决方案 »

  1.   

    function A107A010_28_ValueProperty(obj){
      var isPass = false;
      isPass = true;
      if(!isPass&&!__HAVEERROR){
        if(confirm("你录入的数据超出了指标的范围,是否修改?")){
          __HAVEERROR = true;
          event.srcElement.focus();//把焦点设置在触发事件的元素上
          event.srcElement.select();//让触发事件的元素值选中
          setTimeout("__HAVEERROR = false",10);//隔10毫秒后执行语句:__HAVEERROR=false
          event.cancelBubble = true;//取消事件冒泡,即事件不向父元素传递
          event.keyCode = '0'
          return false;//返回false
        }
      }
      return true;
    }