B/S结构中的时间输入控件[1]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 191301587 的 blog

<!--
调用很简单,再想要调用的位置插入代码
<script>
var timeconctrlname = new minutecontrol("timeconctrlname","pageconctrlname");
document.write(timeconctrlname);

以下两行作为赋值值用,一般在b/s系统中的修改时必须
//document.all.pageconctrlname.value="09:09:09";
//timeconctrlname.setinitcontrol();
</script>

全部代码如下:
-->

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

<html>
<head>
 <title>时间控件</title>
</head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<script language="javascript">

</script>
<script language="javascript">
// written by cloudchen, 2004/03/15
// modfiy by wangwq@atools 2004-8-25
// modfiy by wangwq@atools 2004年8月26日 0:10:43
function minutecontrol(name,forobj,fname) {
 this.name = name;
 this.fname = fname || "mctr_input";
 
 this.timer = null;
 this.fobj = null;
 
 this.tostring = function() {
  var objdate = new date();
  var sminute_common = "class=\"mctr_input\" maxlength=\"2\" name=\""+this.fname+"\" onfocus=\""+
   this.name+".setfocusobj(this)\" onblur=\""+this.name+".settime(this)\" onkeyup=\""+
   this.name+".prevent(this)\" onkeypress=\"if (!/[0-9]/.test(string.fromcharcode(event.keycode)))event.keycode=0\" \
   onpaste=\"return false\" ondragenter=\"return false\" style=\"ime-mode:disabled\" onpropertychange=\""+
   this.name+".setforobjvalue()\"";
  var sbutton_common = "class=\"mctr_arrow\" onfocus=\"this.blur()\" onmouseup=\""+this.name+".controltime()\" disabled"
  var str = "";
  str +=" <style type=\"text/css\">"
  str +=" .mctr_frameborder {"
  str +="  border-left: 2px inset #d4d0c8;"
  str +="  border-top: 2px inset #d4d0c8;"
  str +="  border-right: 2px inset #ffffff;"
  str +="  border-bottom: 2px inset #ffffff;"
  str +="  width: 152px;"
  str +="  height: 22px;"
  str +="  background-color: #ffffff;"
  str +="  overflow: hidden;"
  str +="  text-align: left;"       //text-align: right;
  str +="  font-family: \"tahoma\";"
  str +="  font-size: 12px;"
  str +=" }"
  str +=" .mctr_arrow {"
  str +="  width: 16px;"
  str +="  height: 10px;"
  str +="  font-family: \"webdings\";"
  str +="  font-size: 9px;"
  str +="  line-height: 2px;"
  str +="  padding-left: 2px;"
  str +="  cursor: default;"
  str +=" }"
  str +=" .mctr_input {"
  str +="  width: 18px;"
  str +="  height: 14px;"
  str +="  border: 0px solid black;"
  str +="  font-family: \"tahoma\";"
  str +="  font-size: 12px;"
  str +="  text-align: right;"
  str +=" }"
  str +=" </style>";
  str += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
  str += "<tr>"
  str += "<td>"
  str += "<div class=\"mctr_frameborder\">"
  str += "<input radix=\"24\" value=\""+this.formattime(objdate.gethours())+"\" "+sminute_common+">:"
  str += "<input radix=\"60\" value=\""+this.formattime(objdate.getminutes())+"\" "+sminute_common+">:"
  str += "<input radix=\"60\" value=\""+this.formattime(objdate.getseconds())+"\" "+sminute_common+">"
  str += "</div>"
  str += "</td>"
  str += "<td>"
  str += "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">"
  str += "<tr><td><button id=\""+this.fname+"_up\" "+sbutton_common+">5</button></td></tr>"
  str += "<tr><td><button id=\""+this.fname+"_down\" "+sbutton_common+">6</button></td></tr>"
  str += "</table>"
  str += "</td>"
  str += "<td>"

本文关键:B/S结构中的时间输入控件
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top