<div onkeydown="javascript:if(event.keyCode==13) search()">

<br >

ISBN<span style="color:red">*</span>:<input name="Text1" type="text" id="searchbox" value="-" >
书名<span style="color:red">*</span>:<input name="Text1" type="text" id="searchbox2" value="">
年:<select name="Select1" id="Select1">
<option></option>
<option></option>
<option></option>
<option></option>
<option>-------</option>
<option></option>
<option></option>
<option></option>
</select>
季:<select name="Select2" id="Select2" style="width: 96px">
<option>春季</option>
<option>秋季</option> </select>
<input name="button1" type="submit" value="提交" id="searchbtn" onclick="search()"> <script type="text/jscript">
//js获取地址栏参数
function getQueryString(name)
{
var reg=new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
var r=window.location.search.substr().match(reg);
if(r!=null)
return unescape(r[]);return null;
}
// 调用方法
//alert(GetQueryString("参数名1"));
//alert(GetQueryString("参数名2"));
//alert(GetQueryString("参数名3")); //查找函数
function search()
{
//alert("ok");
var k=document.getElementById("searchbox").value;
k=escape(k);
if(k==null)
document.getElementById("serchbox").value="-"; var k2=document.getElementById("searchbox2").value; if(typeof(k2)=="undefined" || k2==null || k2.length<) //string 类型 内容为空
{
alert("请输入书名!");
document.getElementById("searchbox2").focus();
return;
}
k2=escape(k2); //if(typeOf(k2)=="undefined")
//document.getElementById("searchbox2").value="图"; var drop = document.getElementById("Select1");
var k3=drop.options[drop.selectedIndex].value;
//获取select的值
k3=escape(k3); var drop2 = document.getElementById("Select2");
var k4=drop2.options[drop2.selectedIndex].value;
//获取select的值
k4=escape(k4); window.location.href="http://point/jcfs/SitePages/xtjh.aspx?k="+k+"&k2="+k2+"&k3="+k3+"&k4="+k4; }
//传递参数刷新界面后保留之前输入的控件框中的内容 首次加载时 k k2均为空
//escape 对字符串进行编码 unescape 对字符串进行解码
document.getElementById("searchbox").value=unescape(getQueryString("k"));
document.getElementById("searchbox2").value=unescape(getQueryString("k2"));
//if(k2=="_") document.getElementById("searchbox2").value="";
var drop = document.getElementById("Select1");
for(i=;i<drop.length;i++)
{//给select赋值
if(unescape(getQueryString("k3"))==drop.options[i].value)
{
drop.options[i].selected=true
}
}
var drop2 = document.getElementById("Select2");
for(i=;i<drop2.length;i++)
{//给select赋值
if(unescape(getQueryString("k4"))==drop2.options[i].value)
{
drop2.options[i].selected=true
}
}//end </script>
<br >
</div>

xtjh的更多相关文章

  1. 51. N-Queens

    题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two que ...

  2. aop测试jdk代理机制

    //测试jdk代理机制 @Test public void testProxy(){ final UsbDisk usbDisk = new UsbDisk(); //类加载器,接口,匿名内部类 // ...

  3. openstack grizzly版network网络节点安装

    版本以及源的配置和控制节点一致 1.安装完操作系统已经apt源配置完成之后,一定要执行 apt-get update root@cloud:~# mv /etc/apt/sources.list /e ...

随机推荐

  1. Vue.2.0.5-单文件组件

    介绍 在很多Vue项目中,我们使用 Vue.component 来定义全局组件,紧接着用new Vue({ el: '#container '}) 在每个页面内指定一个容器元素. 这种方案在只是使用 ...

  2. SQL Update实现使用一个表的数据更新另一张表

    表结构 功能 SQL Serevr Access 表结构

  3. 在Hyper-V的虚拟机中使用无线网络

    今天在WINDOWS 8.1中装了WINDOWS 7的虚拟机,但默认情况下只能共享有线网络,而没有无线网络. 解决方法: http://www.elmajdal.net/Win2k8/Enabling ...

  4. Python生成8位随机密码

    #!/usr/bin/env python # -*- coding: utf- -*- import random import string #第一种方法 seed = "1234567 ...

  5. PAT 解题报告 1007. Maximum Subsequence Sum (25)

    Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, ...

  6. 安装windowbuilder错误一例

    eclipse是3.7版本,安装了windowbuilder,大致步骤如下: http://www.cnblogs.com/gladto/archive/2011/07/21/2112836.html ...

  7. Codeforce Round #213 Div2

    哎,弄了半天这次的C还是没出,真是捉急!,还TM的以为前几次只是运气不好!太逗了!

  8. WEB简单数据操作练习

    主要学习代码: Login.aspx: <!--第一种方式--> <%-- <script type="text/javascript"> funct ...

  9. "数学口袋精灵"bug的发现及单元测试

    1.项目内容: 团队项目:二次开发 至此,我们有了初步的与人合作经验,接下来投入到更大的团队中去. 也具备了一定的个人能力,能将自己的代码进行测试.接下来尝试在别人已有的基础上进行开发. 上一界51冯 ...

  10. Sping中的事务配置

    关于Spring的事务配置,主要的配置文件如下(使用了C3P0连接池): <?xml version="1.0" encoding="UTF-8"?> ...