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 ...
随机推荐
- 导出iPhone中安装的APP的iPA文件
1.让iPhone连接电脑,打开iTunes,选择本电脑,然后点立即备份. 2.完成上一步的操作之后,选择应用,在iTunes中就会列出你从App Store中下载的应用,自己连接真机调试的应用是没有 ...
- node.js中使用node-schedule实现定时任务
摘要:有时我们需要在每天的固定时间执行某个脚本,或者在某个固定时间执行某个任务.NodeJS中的 node-schedule 可以很好的实现定时任务. 1.安装 npm install node-sc ...
- Leetcode: Graph Valid Tree && Summary: Detect cycle in undirected graph
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), ...
- hdu 2892 Area
http://acm.hdu.edu.cn/showproblem.php?pid=2892 解题思路: 求多边形与圆的相交的面积是多少. 以圆心为顶点,将多边形划分为n个三角形. 接下来就求出每个三 ...
- HDU 1890 区间反转
http://acm.hdu.edu.cn/showproblem.php?pid=1890 Robotic Sort Problem Description Somewhere deep in th ...
- escape()、encodeURI()、encodeURIComponent() difference
escape() 方法: 采用ISO Latin字符集对指定的字符串进行编码.所有的空格符.标点符号.特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编 ...
- interesting js
[5/3/2016 4:18 PM] Calos Chen: function a(b,e){var a=0;a+=b;if(e){console.log(b+e);return;} retur ...
- 【你吐吧c#每日学习】11.10 C# Data Type conversion
implicit explicit float f=12123456.213F int a = Convert.ToInt32(f); //throw exception or int a = (in ...
- HDU 3685 Rotational Painting(多边形质心+凸包)(2010 Asia Hangzhou Regional Contest)
Problem Description Josh Lyman is a gifted painter. One of his great works is a glass painting. He c ...
- POJ 3243 Clever Y(离散对数-拓展小步大步算法)
Description Little Y finds there is a very interesting formula in mathematics: XY mod Z = K Given X, ...