文体框取得焦点
<script type="text/javascript">
       
function ischeck(){
               
document.getElementById('title').focus();
        }

</script>

</head>
<body  onload="ischeck()">

<input type="text" name="title"

多行<textarea rows="7" name="s1" cols="60" 语法放这里>

单行<input type="text" name="t1" size="15" 语法放这里>

 

///////////////////////////////////////////////////////////////////////////////////////

我的应用

<!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=gb2312" />
<title>药品查询</title>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body onload="ischeck()">


<form >
 

  <input name="txtstudentname" type="text" ]<2) )
 

if ( (($action="查找")  and  ($_GET["page"]<1) ) or ($ff=$sw ) )
 
   {
    // $sw=$_POST['txtstudentname'];
 session_start();//启动session
   $_SESSION['username'] = $sw;
   //$bb = 'btno';
 
   $sql="select ypbm as 编码 ,ypmc as 药品名称,pybm from ypk";
  //$sql=sprintf("%s where tym like '%%%s%%' ",$sql,$_POST['txtstudentname']);
   $sql=sprintf("%s where (ypmc like '%%%s%%') or (pybm like '%%%s%%')",$sql,$sw,$sw);
  //show_result($sql,$student,"搜索结果","368");
 
 //echo $sql;
 $page_size=17;
  pagingclk($PHP_SELF,$sql,$student,$page_size,"分页显示记录集",368,$sw);
 
 
    }
  else
   {
  // $sw=$_GET["swi"];
    //$sw= isset($_GET["ss"]) ? $_GET["ss"]:'';//取得url中ss后的值
  session_start();//启动session
 $sw=print_r($_SESSION['username'],true);

 
  $sql="select ypbm as 编码 ,ypmc as 药品名称 ,pybm from ypk";
  //$sql=sprintf("%s where tym like '%%%s%%' ",$sql,$_POST['txtstudentname']);
   $sql=sprintf("%s where (ypmc like '%%%s%%') or (pybm like '%%%s%%') ",$sql,$sw,$sw);
   //echo $ff,$sw,$sql,"fffffff";
  
   $page_size=17;
 paging($PHP_SELF,$sql,$student,$page_size,"分页显示记录集",368,$sw);
 
  }
 
  ?>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {isRequired:false});
//-->

function test()
{ alert('click me!');}
document.onkeydown=function()
{  if (event.keyCode == 13)
{  document.getElementById("btnsearch").click();
     

 }}

     
   
     function ischeck(){
                document.getElementById('txtstudentname').focus();
        }

   

</script>
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-21
  • 2021-11-30
  • 2021-11-04
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案