- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_mulform.aspx.cs" Inherits="test_mulform" %>
-
- <!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 runat="server">
- <title></title>
-
- <script type="text/javascript">
- function responseEnter(e) {
- // 响应回车
- var key = window.event ? e.keyCode : e.which;
- if (key == 13) {
- //alert("回车了");
- search();
- }
- }
- function search() {
- // 搜索
- var key = document.getElementById("key").value;
- if (key.length == 0) {
- document.getElementById("key").focus(); //无效
- alert("请输入搜索关键字!");
- } else {
- var url = "SearchItem.aspx?key=" + encodeURI(key) + "&typeid=0&typename=所有分类";
- window.open(url);
- }
- }
- </script>
-
- </head>
- <body>
- <form id="form1" runat="server" onsubmit="return false;">
- <input id="key" type="text" onkeypress="responseEnter(event);" />
- <button style="cursor: pointer;" onclick="search();" type="button">
- 搜索
- </button>
- <div><%=DateTime.Now %></div>
- </form>
- </body>
- </html>
posted @
2010-07-26 08:47
zhdonghu
阅读(
349)
评论()
编辑
收藏
举报