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 ...
随机推荐
- 编译php 转
LAOGAO added 20140907: configure: error: mcrypt.h not found. Please reinstall libmcrypt.复制代码 代码如下:wg ...
- HTML5与HTML4的比较
HHTML5封装一些标签和属性,方便了开发. <form> <p> <label>Username:<input name="search" ...
- [usaco jan 09] 安全路径 travel [最短路径树]
题面: 传送门 思路: 既然最后一条边不能走,那么就一定是换了一条路,一条不经过这最后一条边的路 如果想要这条路最短,那么其在路上一定尽可能多地走了最短路径 因此,我们对这张图跑一遍从1开始的单源最短 ...
- shell if 条件语句实践
对于if 语法 我们不过多做介绍,这里直接上实例,以开发rsync服务启动脚本为例,先对rsync做个简单介绍 [root@backup ~]# rpm -qa|grep rsync rsync--. ...
- callee返回正被执行的Function对象
arguments.length是实参长度, arguments.callee.length是形参长度. function fn(a, b, c, d) { console.log(arguments ...
- Hyperledger Fabric 环境配置
简单说一下 Hyperledger Fabric的配置 1.第一步,安装curl brew install curl 注:没有brew的自行百度(mac) 2. 安装Docker 下载并安装Docke ...
- codeforce div2 426 D. The Bakery
D. The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard inp ...
- 【Windows Message】MFC 通过F5,刷新桌面
//通过F5,刷新桌面 HWND hWndProgram = ::FindWindow( _T("Progman"), NULL); HWND hWndDefView = ::Fi ...
- glRectf(-0.5f, -0.5f, 0.5f, 0.5f)
http://bbs.csdn.net/topics/370049656 x向右,y向上时OPENGL坐标系,z向屏幕外表示正方向(-0.5,-0.5)是左下角坐标,(0.5,0.5)是右上角坐标,, ...
- [翻译]现代Linux系统上的栈溢出攻击【转】
转自:http://www.codeweblog.com/%E7%BF%BB%E8%AF%91-%E7%8E%B0%E4%BB%A3linux%E7%B3%BB%E7%BB%9F%E4%B8%8A%E ...