div下拉框(待改善)
不说话,直接上代码,其中函数dealchose()没有实现,各位就不必纠结了
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'div下拉.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script> function dealClick(){
var reasonStr = document.getElementById("zsyy"); //需要弹出下拉列表的文本框
var repairList = document.getElementById("reasons"); //要弹出的下拉列表
var divClose = document.getElementById("tdClose");
var reasonOptions = document.getElementsByName("zsyys"); //所有列表元素
var zsyystr=new Array();//输入框填写的注塑原因
zsyystr=reasonStr.value.split(";");
var bNoAdjusted = true; for(var i=0;i<reasonOptions.length;i++){
for(var j=0;j<zsyystr.length;j++){
if(reasonOptions[i].value==zsyystr[j]){
reasonOptions[i].checked=true;
}
}
}
divClose.onclick = function()
{
repairList.style.display = "none";
if(reasonStr.value==''){
reasonStr.value="单击文本框选择修模原因";
reasonStr.style.color='#999999';
}
};
//文本获得焦点时的事件
reasonStr.onfocus = function()
{ repairList.style.display = "block";
if(reasonStr.value=="单击文本框选择修模原因"){
reasonStr.value='';
reasonStr.style.color='#000000';
}else{
reasonStr.style.color='#000000';
}
//reasonStr.style.color='#000';
if (bNoAdjusted)
{ bNoAdjusted = false;
//设置下拉列表的宽度和位置
repairList.style.width =166;
repairList.style.posTop = 40;
repairList.style.posLeft = 118; }
}
} </script> </head> <body> <table>
<tr>
<td width="100" height="25" class="tableshortleftbg">注塑修模原因</td>
<td >
<input type="text" onMouseDown="dealClick()" id="zsyy" name="zsyy" size="22" value="单击文本框选择修模原因" style="color: #999999" readonly="readonly" /> <font color="red">*</font>
<div id="reasons" style="display: none; border: 1px solid #000000; overflow: hidden; height: 150px; width: 50px; position: absolute; ">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="1" align="left" width="100px" style=" overflow: auto; height: 30px; background-color: #FFFFFF;">
<input name="zsyys" type="checkbox" value="毛刺" onClick="dealChosen()">毛刺
</td>
<td colspan="1" align="left" width="100px" style=" overflow: auto; height: 30px; background-color: #FFFFFF;">
<input name="zsyys" type="checkbox" value="脱模剂" onClick="dealChosen()">脱模剂
</td>
</tr>
<tr>
<td colspan="1" align="left" width="95px" style=" overflow: auto; height: 30px; background-color: #FFFFFF;">
<input name="zsyys" type="checkbox" value="油污" onClick="dealChosen()">油污
</td> <td align="left" style=" overflow: auto; height: 35px; background-color: #FFFFFF;">
<input name="zsyys" type="checkbox" value="浇口" onClick="dealChosen()">浇口
</td>
</tr>
<tr>
<td align="left" style=" overflow: auto; height: 30px; background-color: #FFFFFF;" >
<input name="zsyys" type="checkbox" value="机械手" onClick="dealChosen()">机械手
</td>
<td align="left" style=" overflow: auto; height: 30px; background-color: #FFFFFF;">
<input name="zsyys" type="checkbox" value="变形" onClick="dealChosen()">变形
</td> </tr> <tr>
<td colspan="3" align="left" style=" overflow: auto; height: 30px; background-color: #FFFFFF;">
<input name="zsyys" type="checkbox" value="修模不合格" onClick="dealChosen()">修模不合格
</td>
</tr> <tr>
<td colspan="3" height="30px" align="center" id="tdClose" style="cursor: hand; background-color:#CCCCCC;" ><b>关闭</b></td>
</tr>
</table>
</div>
</td> <td class="tableshortleftbg"> </td>
<td width="100" class="tableshortleftbg">修模原因备注</td>
<td><input type="text" name="yyrm" size=22 maxlength=50 ></td>
<td class="tableshortleftbg"> </td>
<td width="100" class="tableshortleftbg">紧急程度</td>
<td>
<input type="radio" name="jjcd" id="jj" size=22 maxlength=20 readonly="readonly " value="紧急"><span><b><font color="red">紧急</font></b></span>
<input type="radio" name="jjcd" id="fj" size=22 maxlength=20 readonly=" readonly" value="非紧急"><span><b><font color="red">非紧急</font></b></span>
</td>
<td class="tableshortleftbg"> </td>
</tr>
</table> </body>
</html>
div下拉框(待改善)的更多相关文章
- jquery div 下拉框焦点事件
这章与上一张<jquery input 下拉框(模拟select控件)焦点事件>类似 这章讲述div的焦点事件如何使用 div的焦点事件与input的焦点事件区别在于 需要多添加一个属性: ...
- jquery学习笔记:获取下拉框的值和下拉框的txt
<div class="form-group"> <select class="form-control" id="iv_level ...
- vue获取下拉框值
vue获取下拉框的值,用vue-modle,只有点击下拉框的值才会赋值到下拉框中,初始时下拉框没有数据,而改用$event就不会出现这样的问题,下面看代码以及图解: v-model解决方式: < ...
- 前端 HTML form表单标签 select标签 option 下拉框
<select></select> select里面通常跟option配合使用 <!DOCTYPE html> <html lang="en&quo ...
- JS Div滚动,下拉框添加属性,年月日下拉条
创建某一下拉菜单的项: str = str+"<option value='"+i+"'>"+i+"</option>&quo ...
- div自定义下拉框
因为原生的下拉框不能修改其属性,很难美化下拉框. 所以自己用div简单自定义了一下下拉框,想美化直接修改css即可 <!DOCTYPE html> <html lang=" ...
- 用div,ul,input模拟select下拉框
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- div模拟的下拉框特效
随笔- 4 文章- 0 评论- 0 ? <style type="text/css"> body, ul, li { margin: 0; padding: 0; fo ...
- div模拟的下拉框特效jquery
从网上找来的,感觉不错就拿来分享下 <style type="text/css"> body, ul, li { margin: 0; padding: 0; font ...
随机推荐
- 构建乘积数组--java
题目:给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1].不能使 ...
- MySql数据库 - 4.可视化操作数据库
创建表 对表中数据进行 增.删.改.查 查 右键刚刚创建的表 - 选择查看前 1000 条数据 增.改 表格必须有主键才能添加数据,主键是不能重复的 1. 右键表 - 查看前 1000 条数据 2. ...
- Emma中文乱码解决方法
vim -/.emma/emmarc db_encoding=latin1 改为 db_encoding=utf8 sudo vim /usr/share/emma/emmalib/mysql_hos ...
- C#,一种简单的方式实现滚动鼠标缩放图片,平移
1.缩放 private void ImageShow_Load(object sender, EventArgs e) { pictureBox1.Load(@"E:\SQ1.jpg&qu ...
- 【一个比较bug free的二分写法】
lower_bound: [l, r)区间内大于等于val的第一个位置 int lower_bound(int l, int r, int val){ while(l < r){ ); if(a ...
- BootLoader的一些知识
在嵌入式操作系统中,BootLoader是在操作系统内核运行之前运行.可以初始化硬件设备.建立内存空间映射图,从而将系统的软硬件环境带到一个合适状态,以便为最终调用操作系统内核准备好正确的环境.在嵌入 ...
- 19年的桌面KDE的风雨和陪伴,没有什么能够割舍
概述 KDE是史上功能最强大的桌面环境之一:开源且可自由使用.19年前,1996年10月14日,德国程序员 Matthias Ettrich 开始了这个美观的桌面环境的开发.KDE 提供了用户界面以及 ...
- HDU5032 Always Cook Mushroom(树状数组&&离线)
树状数组+询问离线.一个优化是需要的,就是先对1000*1000个点先排序,而不是每次都生成这1000*1000个点然后和询问一起排序,那样会tle. #include <iostream> ...
- nodejs递归创建目录
var fs = require("fs"); var path = require("path"); // 递归创建目录 异步方法 function mkdi ...
- Android修改包名的方法,简单粗暴。
几分钟之内,简单粗暴的修改包名! 序:Android的新手玩家可能对修改包名这件事情很是烦恼,我这里给出一个最快的修改包名的方法,简单粗暴,喜欢的可以收藏一下. 开始修改 第一步:修改自己app mo ...