官答多 发表于 4 天前

01

  
  姓名:
  
  
  function init(){
  document.onkeydown=function(e){
  var a=e||window.event;
  if(a.ctrlKey&&a.keyCode==13){
  if($("username").value=="")
  {
  alert('请输入姓名');
  $("username").focus();
  return false;
  }
  document.getElementById("theForm").submit();
  }
  }
  }
  function $(id)
  {
  return document.getElementById(id);
  }
  window.onload=init;
  
页: [1]
查看完整版本: 01