xtjh
<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的更多相关文章
- 51. N-Queens
题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two que ...
- aop测试jdk代理机制
//测试jdk代理机制 @Test public void testProxy(){ final UsbDisk usbDisk = new UsbDisk(); //类加载器,接口,匿名内部类 // ...
- openstack grizzly版network网络节点安装
版本以及源的配置和控制节点一致 1.安装完操作系统已经apt源配置完成之后,一定要执行 apt-get update root@cloud:~# mv /etc/apt/sources.list /e ...
随机推荐
- Django 学习
urls.py 路由系统 from django.conf.urls import url,includefrom django.contrib import adminfrom web import ...
- 在Entity Framework 4.0中使用 Repository 和 Unit of Work 模式
[原文地址]Using Repository and Unit of Work patterns with Entity Framework 4.0 [原文发表日期] 16 June 09 04:08 ...
- IntelliJ IDEA Community Edition 14.1.4下 javafx scenebuilder的使用
官网对应的配置文档:https://www.jetbrains.com/idea/help/preparing-for-javafx-application-development.html Java ...
- 多语言本地化开发Localized
NSString * ViewsLocalizedStringFormat(NSString *key,NSString *defValue); // Handle localized strings ...
- PostgreSQL Configuration – managing scary settings
When it comes to highly available database servers and configuration, a very important aspect is whe ...
- PostgreSQL Replication之第十二章 与Postgres-XC一起工作(2)
12.2安装 Postgres-XC 可以从 http://postgres-xc.sourceforge.net/下载Postgres-XC.对于本书,我们使用1.0.3版本的Postgres-XC ...
- Snapchat面经(师兄的)
给一个LinkedList环,给其中任一个节点的reference,求删去LinkedList中所有value=k的点 我的想法:假设给定的点事ListNode oneNode, 设置ListNode ...
- git的基本使用
1.在本地新建一个文件夹来存放代码 2.用命令行进入这个文件夹 3.git init --来创建一个代码仓库 3. 配置用户信息:用户名和 邮箱(联系作者本人沟通, 责任到人) git config ...
- poj: 3094
简单题 #include <iostream> #include <stdio.h> #include <string> #include <stack> ...
- 夺命雷公狗---DEDECMS----10dedecms双标签
双标签基本语法如下: {dede:标签名 参数名=“值” 参数名2=“值”...} 内容...... {/dede} 我们先来查看下手册,如下所示: 我们先来用一个channel的标签来做实例,因为c ...