求一时间选择控件 不要有日期,只要时和分 小弟看了些很多日期+时间的控件,貌似还是不会改成只能选择时和分的控件。。(我打算点击触发控件后,弹出2个下拉框,一个时(24),一个分(60),然后选择后返回值给指定textbox)跪求高人成全!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自已做两个下拉框,分别放入时分.点击textbox时,显示这两个下拉框,将选择时分后,使用select的onchang事件将值赋到textbox中. 时分是固定的,所以没特殊需要不用做特殊处理.. js 如下var str = ""; document.writeln(" <div id=\"_contents\" style=\"padding:6px; background-color:#E3E3E3; font-size: 12px; border: 1px solid #777777; position:absolute; left:?px; top:?px; width:?px; height:?px; z-index:1; visibility:hidden\">"); str += "\u65f6 <select name=\"_hour\">"; for (h = 0; h <= 9; h++) { str += " <option value=\"0" + h + "\">0" + h + " </option>"; } for (h = 10; h <= 23; h++) { str += " <option value=\"" + h + "\">" + h + " </option>"; } str += " </select> \u5206 <select name=\"_minute\">"; for (m = 0; m <= 9; m++) { str += " <option value=\"0" + m + "\">0" + m + " </option>"; } for (m = 10; m <= 59; m++) { str += " <option value=\"" + m + "\">" + m + " </option>"; } str += " </select> \u79d2 <select name=\"_second\">"; for (s = 0; s <= 9; s++) { str += " <option value=\"0" + s + "\">0" + s + " </option>"; } for (s = 10; s <= 59; s++) { str += " <option value=\"" + s + "\">" + s + " </option>"; } str += " </select> <input name=\"queding\" type=\"button\" onclick=\"_select()\" value=\"\u786e\u5b9a\" style=\"font-size:12px\" /> </div>"; document.writeln(str); var _fieldname; function _SetTime(tt) { _fieldname = tt; var ttop = tt.offsetTop; //TT控件的定位点高 var thei = tt.clientHeight; //TT控件本身的高 var tleft = tt.offsetLeft; //TT控件的定位点宽 while (tt = tt.offsetParent) { ttop += tt.offsetTop; tleft += tt.offsetLeft; } document.all._contents.style.top = ttop + thei + 4; document.all._contents.style.left = tleft; document.all._contents.style.visibility = "visible"; } function _select() { _fieldname.value = document.all._hour.value + ":" + document.all._minute.value + ":" + document.all._second.value; document.all._contents.style.visibility = "hidden"; } html 如下<html> <head> <script src="date.js" language="javascript"></script> </head> <body> <input type="text" name="d" style="width:120px;" onclick="_SetTime(this)" readOnly="true"> </body></html> 如何判断radio选中了哪个值 Table点击表头排序的js代码问题 请高手解决下问题,关于点击触发的 <script src='***'></script>问题 去空格 求个简单正则 onDragEnter事件能不能获取被托动的信息 作品发布:新闻组阅读器(JS+FLASH+XML+ADO+FSO+ASP.NET) 用xml的load() 请问可不可以用javascript来把表单(form)里的内容,直接发到邮箱里??? ExtJs分页后传值问题 poi写excel的换行问题
document.writeln(" <div id=\"_contents\" style=\"padding:6px; background-color:#E3E3E3; font-size: 12px; border: 1px solid #777777; position:absolute; left:?px; top:?px; width:?px; height:?px; z-index:1; visibility:hidden\">");
str += "\u65f6 <select name=\"_hour\">";
for (h = 0; h <= 9; h++) {
str += " <option value=\"0" + h + "\">0" + h + " </option>";
}
for (h = 10; h <= 23; h++) {
str += " <option value=\"" + h + "\">" + h + " </option>";
}
str += " </select> \u5206 <select name=\"_minute\">";
for (m = 0; m <= 9; m++) {
str += " <option value=\"0" + m + "\">0" + m + " </option>";
}
for (m = 10; m <= 59; m++) {
str += " <option value=\"" + m + "\">" + m + " </option>";
}
str += " </select> \u79d2 <select name=\"_second\">";
for (s = 0; s <= 9; s++) {
str += " <option value=\"0" + s + "\">0" + s + " </option>";
}
for (s = 10; s <= 59; s++) {
str += " <option value=\"" + s + "\">" + s + " </option>";
}
str += " </select> <input name=\"queding\" type=\"button\" onclick=\"_select()\" value=\"\u786e\u5b9a\" style=\"font-size:12px\" /> </div>";
document.writeln(str);
var _fieldname;
function _SetTime(tt) {
_fieldname = tt;
var ttop = tt.offsetTop; //TT控件的定位点高
var thei = tt.clientHeight; //TT控件本身的高
var tleft = tt.offsetLeft; //TT控件的定位点宽
while (tt = tt.offsetParent) {
ttop += tt.offsetTop;
tleft += tt.offsetLeft;
}
document.all._contents.style.top = ttop + thei + 4;
document.all._contents.style.left = tleft;
document.all._contents.style.visibility = "visible";
}
function _select() {
_fieldname.value = document.all._hour.value + ":" + document.all._minute.value + ":" + document.all._second.value;
document.all._contents.style.visibility = "hidden";
}
<head>
<script src="date.js" language="javascript"></script>
</head>
<body>
<input type="text" name="d" style="width:120px;" onclick="_SetTime(this)" readOnly="true">
</body>
</html>