日期:2014-05-16  浏览次数:20464 次

JS虚拟键盘退格问题求解决!
主要是不能实现点击其中一个文本框输入数据后再点退格,还是退的上面行的,重查也是这样的,不能满足2个框共用,这个真不是很懂唉,再请教下大哥!以下是代码!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<script>
var i=1;
function ad(str)
{
  eval("document.form"+i+".p1.value = document.form"+i+".p1.value + str");
}
</script>
<style>
/* CSS Document */
body{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
  }

h1, h2, h3, h4, h5, h6, p {
margin-top:0px;
padding-right:0px;
padding-left:0px;
}
#center{margin-left:auto; margin-right:auto}
ul,li{
list-style:none outside none;
margin:0;
padding:0;
}
#all{ width:1080px; height:750px; margin:0 auto; border:#003399 solid 1px; background:url(image/loginimg/4.jpg) no-repeat;}  
.in input{ width:218px; height:28px; line-height:28px; display:block; font-size:26px; background:#FFFFFF; border:#006666 1px solid; padding-left:5px; color:#0066FF;}
.info{background:url(image/loginimg/pics.jpg) no-repeat;}
.in{ width:451px; margin:0 auto; margin-top:220px;}

.in .haoma{ width:451px; height:46px; margin-bottom:20px;}
.in .haoma li{ float:left; }
.in .haoma .k1{padding-top:6px; }
.in .haoma .k2{padding-top:10px; height:28px; line-height:28px; color:#006633; font-weight:bold;padding-left:66px;display:inline; }
.in .anniu{ height:55px; width:451px; text-align:center;}
.in .anniu li{ height:39px; width:65px; float:right; text-align:center; line-height:39px;display:block; margin:9px;_margin:4px 0 0 2px;margin-right:15px;}
.in .anniu img{ border:none;}
  .in .anniu li a{ color:#3399CC; font:"Verdana"; font-size:23px; font-weight:bolder; text-decoration:none; display:block; }
  .in .anniu li a:active{ height:39px; display:block; color:#F00; }
  .in .anniu image/loginimg{ border:none; }
 
.in .xia{ height:52px; width:451px; text-align:center;background:url(image/loginimg/111.jpg) no-repeat;}
.in .xia img{ border:none;}
  .in .xia li{ display:inline; margin:10px; width:45px; height:52px;color:#009999; }
  .in .xia a{ color:#336633; font-weight:bold;}
  .in .xia image/loginimg{ border:none; margin-top:5px;}
   
  .in .tool{ height:32px; width:228px; margin-left:12px;}
  .in .tool li{ float:left; display:inline; width:57px; text-align:center;}
  .in .tool image/loginimg{ border:none; cursor:pointer; }
  .in .tool a{ display:block; height:32px; width:57px; cursor:pointer;}
  .in .tool a:hover{ display:block;}
   
.in .top{ overflow:hidden; display:block; height:100px;}
  .in .top image/loginimg{ display:block; overflow:hidden;}
.in .buttom{ overflow:hidden; display:block; height:93px; color:#3399CC; color:#FFFFFF}
  in .buttom image/loginimg{ display:block; overflow:hidden;}
.left{ float:left;}
.rigth{ float:left;}
</style>
</head>
<body>
  <div id="all">  
  <div class="in">
  <ul class="haoma">
  <li class="k2">
  户号:&nbsp;
  </li>
  <li class="k1">
  <form method=post action="" name="form1"><input name="p1" type="text" onfocus="i=1;"/></form></li>