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 ...
随机推荐
- 动态生成的chosen实现模糊查询
$('select', newTr).chosen({ width: '100%', search_contains: true }); //初始化复制行下拉框
- CSA Round #84 The Sprawl
题目 Analysis 曼哈顿距离($L1$ metric)最小生成树. Implementation 下面的代码参考了 gispzjz 在比赛中的提交. #include <bits/stdc ...
- 如何在 Windows 7 上安装 TeX Live 2018
$\color{red}{\mathsf{UPDATE}}$:见李阿玲在知乎专栏 All about TeXnique 发布的安装教程 关于 TeX Live:http://tug.org/texli ...
- DOM解析和优化
DOM解析 1. css不会阻塞DOM解析(DOM Tree),但会阻塞DOM渲染(css Tree + DOM Tree -> render Tree )2. JS阻塞DOM解析,但浏览器会预 ...
- crontab中执行java程序的脚本
测试场景说明(操作系统:centos7): 有一个bash脚本,脚本内容是执行某个java程序,该脚本为 /data/project1/start.sh crontab -e,添加了以下任务: * * ...
- Java众神之路(4)-关键字(下)
21.float float是Java原始类型. float变量可以存储单精度浮点值. 示例: float ratio = 0.1f; float diameter = 6.15f; 注释: 使用此关 ...
- 糗事百科python爬虫
# -*- coding: utf-8 -*- #coding=utf-8 import urllib import urllib2 import re import thread import ti ...
- 【11】react 之 flux
Flux 是 Facebook 使用的一套前端应用的架构模式.React 标榜自己是 MVC 里面 V 的部分,那么 Flux 就相当于添加 M 和 C 的部分. 1.1. Flux介绍 Flux并 ...
- SQL只获取字段中的中文字符
原文发布时间为:2010-10-28 -- 来源于本人的百度文章 [由搬家工具导入] 新建标量函数 set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGOALTER f ...
- DataRelation 实现父子表 父子级 Repeater的嵌套使用
原文发布时间为:2009-05-21 -- 来源于本人的百度文章 [由搬家工具导入] DataRelation 实现父子表 if (!IsPostBack) { ...