不说话,直接上代码,其中函数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">&nbsp;</td>
<td width="100" class="tableshortleftbg">修模原因备注</td>
<td><input type="text" name="yyrm" size=22 maxlength=50 ></td>
<td class="tableshortleftbg">&nbsp;</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">&nbsp;</td>
</tr>
</table> </body>
</html>

div下拉框(待改善)的更多相关文章

  1. jquery div 下拉框焦点事件

    这章与上一张<jquery input 下拉框(模拟select控件)焦点事件>类似 这章讲述div的焦点事件如何使用 div的焦点事件与input的焦点事件区别在于 需要多添加一个属性: ...

  2. jquery学习笔记:获取下拉框的值和下拉框的txt

    <div class="form-group"> <select class="form-control" id="iv_level ...

  3. vue获取下拉框值

    vue获取下拉框的值,用vue-modle,只有点击下拉框的值才会赋值到下拉框中,初始时下拉框没有数据,而改用$event就不会出现这样的问题,下面看代码以及图解: v-model解决方式: < ...

  4. 前端 HTML form表单标签 select标签 option 下拉框

    <select></select> select里面通常跟option配合使用 <!DOCTYPE html> <html lang="en&quo ...

  5. JS Div滚动,下拉框添加属性,年月日下拉条

    创建某一下拉菜单的项: str = str+"<option value='"+i+"'>"+i+"</option>&quo ...

  6. div自定义下拉框

    因为原生的下拉框不能修改其属性,很难美化下拉框. 所以自己用div简单自定义了一下下拉框,想美化直接修改css即可 <!DOCTYPE html> <html lang=" ...

  7. 用div,ul,input模拟select下拉框

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  8. div模拟的下拉框特效

    随笔- 4 文章- 0 评论- 0 ? <style type="text/css"> body, ul, li { margin: 0; padding: 0; fo ...

  9. div模拟的下拉框特效jquery

    从网上找来的,感觉不错就拿来分享下 <style type="text/css"> body, ul, li { margin: 0; padding: 0; font ...

随机推荐

  1. hdu 4185 二分图最大匹配

    Oil Skimming Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  2. iOS-文本段落样式NSMutableParagraphStyle与NSParagraphStyle的使用和一些富文本处理属性

    开发过程中,经常会遇到动态计算行高的问题, - (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)op ...

  3. WF 18 A 想法

    UPD:我理解错题意了. 考虑在时刻 $t$ 从站点 $u$ 出发的公交车,将这些车的集合记做 $B(u,t)$,$B(u,t)$ 是个随机变量. 令 $\mathrm{Pr}_{B(u,t)} = ...

  4. SYZOJ 186 [额]你猜是不是DP(哈希+二分答案+二分搜索)

      题目描述 现在给两个仅包含小写字母的字符串a,b ,求a 与b的最长公共连续子串的长度. 输入格式 两个字符串 输出格式 一个整数,为输入的两个字符串的最长公共连续子串的长度 测试样例 输入 qa ...

  5. 挖煤(coal)

    挖煤(coal) solution 我好弱,啥也想不到. 想了很久dp,这有后效性啊. 结果倒着做就可以了,因为后面的不会影响前面的. 考虑前面的影响后面:挖煤相当于让后面所有a[I]*(1+k%) ...

  6. 转载:LeetCode:5Longest Palindromic Substring 最长回文子串

    本文转自:http://www.cnblogs.com/TenosDoIt/p/3675788.html 题目链接 Given a string S, find the longest palindr ...

  7. bzoj2438 杀人游戏 Tarjan强联通

    [bzoj2438][中山市选2011]杀人游戏 Description 一位冷血的杀手潜入 Na-wiat,并假装成平民.警察希望能在 N 个人里面,查出谁是杀手.警察能够对每一个人进行查证,假如查 ...

  8. idea下载多个插件项目启动不了解决方案

    今天下载mybatis plugin插件的时候 有好多个版本的plugin,然后呢,看第二个比较热门,就下载了第二个,然后重启idea发现这个插件貌似得花钱,那算了吧,咱用第一个免费的吧,就又下载了第 ...

  9. 网页制作教程:td也可以溢出隐藏显示【转】

    原文发布时间为:2010-02-05 -- 来源于本人的百度文章 [由搬家工具导入] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stri ...

  10. Windows消息钩取

    @author: dlive @date: 2016/12/19 0x01 SetWindowsHookEx() HHOOK SetWindowsHookEx( int idHook, //hook ...