注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

樱之花

叶散的时候,你明白欢聚;花谢的时候,你明白青春.

 
 
 

日志

 
 
关于我

分类中“我的实验室”是我在日常工作中的一些知识总结,有些写的比较匆忙,可能大家在阅读时会产生困扰,后期有时间我会重新整理编辑,谢谢大家的到访,您们的支持是我前进的动力!

网易考拉推荐

纯DHTML编写的可编辑增删的表格  

2007-03-16 17:19:35|  分类: 网页界面 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

<HTML>

<HEAD>

<META content="text/html; charset=gb2312" http-equiv=Content-Type>

<STYLE type=text/css>BODY {

BACKGROUND: white; COLOR: black; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px

}

.tableData {

BACKGROUND: white; BORDER-BOTTOM: white 1px dashed; BORDER-LEFT: white 1px dashed; BORDER-RIGHT: white 1px dashed; BORDER-TOP: white 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px

}

.tableDataSel {

BACKGROUND: #6090d0; BORDER-BOTTOM: #6090d0 1px dashed; BORDER-LEFT: #6090d0 1px dashed; BORDER-RIGHT: #6090d0 1px dashed; BORDER-TOP: #6090d0 1px dashed; COLOR: white; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px

}

.tableDataHit {

BACKGROUND: #d0e0ff; BORDER-BOTTOM: #d0e0ff 1px dashed; BORDER-LEFT: #d0e0ff 1px dashed; BORDER-RIGHT: #d0e0ff 1px dashed; BORDER-TOP: #d0e0ff 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px

}

.tableDataOver {

BACKGROUND: #d0e0ff; BORDER-BOTTOM: #d0e0ff 1px dashed; BORDER-LEFT: #d0e0ff 1px dashed; BORDER-RIGHT: #d0e0ff 1px dashed; BORDER-TOP: #d0e0ff 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px

}

.controlPanel {

BACKGROUND: silver; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px

}

.controlPanelMouseOver {

BACKGROUND: #d0e0ff; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px

}

.delMouseOver {

BACKGROUND: #d0e0ff; COLOR: black; CURSOR: hand; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 14px

}

.scheduleButtonVisible {

BACKGROUND: silver; BORDER-BOTTOM: gray 1px dashed; BORDER-LEFT: white 1px dashed; BORDER-RIGHT: gray 1px dashed; BORDER-TOP: white 1px dashed; COLOR: black; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 12px

}

</STYLE>

<SCRIPT language=JavaScript>

var modified=0

var currentLine=-1

function lightOn(ln)

{

if (ln==null)

  ln=parseInt(event.srcElement.ln,10)

for (i=1;i<PLList.rows.length;i++)

  if (tdt[i].ln==ln)

   line=i

cln=currentLine

oldLine=-1

for (i=1;i<PLList.rows.length;i++)

  if (tdt[i].ln==cln)

   oldLine=i

if (line==oldLine)

  return

//if td <0 then only clear all title

if (line>0)

{

  document.all.tdt[line].className="tableDataHit";

  document.ecform("date")[line].className="tableDataHit";

  document.ecform("diagnosis")[line].className="tableDataHit";

  document.ecform("medication")[line].className="tableDataHit";

  if (oldLine>0)

  {

   document.all.tdt[oldLine].className="tableData";

   document.ecform("date")[oldLine].className="tableData";

   document.ecform("diagnosis")[oldLine].className="tableData";

   document.ecform("medication")[oldLine].className="tableData";

  }

  currentLine=ln

}

}

function delIt()

{

line=parseInt(event.srcElement.ln,10)

  

if (line>0)

  for (i=1;i<PLList.rows.length;i++)

   if (tdt[i].ln==line)

   {

    if (document.ecform.diagnosis[i].value.length>0 || document.ecform.medication[i].value.length>0 || document.ecform.date[i].value.length>0)

     if (!confirm("Are you sure you want to delete this record?"))

      return

    PLList.deleteRow(i)

   }

}

function modifiedIt(field)

{

// field.value=checkText(field.value);

modified=1

line=parseInt(event.srcElement.ln,10)

  

if (line>0)

   for (i=1;i<PLList.rows.length;i++)

    if (tdt[i].ln==line)

     document.ecform.edit[i].value=1

}

function newHospitalVisit()

{

newRow=PLList.insertRow(PLList.rows.length);

newRow.id="tdt";

newRow.ln=allCount;

newRow.bgColor="#e0e0e0";

newRow.className="tableData";

newRow.onclick=lightOn;

c1=newRow.insertCell(0);

c1.id="delItem";

c1.ln=allCount;

c1.className="scheduleButtonVisible";

c1.onclick=delIt;

c1.onmouseover=mouseOver;

  c1.onmouseout=mouseOut;

c1.innerHTML="<input type=hidden value=0><input type='hidden' value=0>";

c2=newRow.insertCell(1);

c2.ln=allCount;

c2.innerHTML="<input type=text size=10 maxlength=10 ln="+allCount+" >"

c3=newRow.insertCell(2);

c3.ln=allCount;

c3.innerHTML="<input type=text size=25 maxlength=50 ln="+allCount+" >"

c4=newRow.insertCell(3);

c4.ln=allCount;

c4.innerHTML="<input type=text size=58 maxlength=100 ln="+allCount+" >"

allCount++

}

function mouseOver()

{

event.srcElement.className="delMouseOver"

}

function mouseOut()

{

event.srcElement.className="scheduleButtonVisible"

}

</SCRIPT>

</HEAD>

<BODY bgColor=white>

<FORM method=post >

  <META content="MSHTML 5.00.2920.0" >

  <DIV

style="LEFT: 0px; ; TOP: 0px; VISIBILITY: visible; WIDTH: 658px">

    <TABLE bgColor=silver border=2 borderColorDark=gray borderColorLight=silver

cellPadding=2 cellSpacing=1 cols=1 rules=rows width="100%">

      <TBODY>

      <TR bgColor=#0a6846

        <TH width=10><FONT color=white>X

          <INPUT type=hidden>

          <INPUT

      name=edit type=hidden>

          </FONT></TH>

        <TH width="10%">

          <INPUT type=hidden>

          <FONT color=white>Date </FONT>

        <TH width="30%">

          <INPUT type=hidden>

          <FONT

      color=white>Diagnosis </FONT>

        <TH width="60%">

          <INPUT type=hidden>

          <FONT

      color=white>Medication </font>

      </TR>

      <TR bgColor=#e0e0e0 ln="1">

        <TD

    onmouseover=mouseOver() ln="1"><FONT size=2>

          <INPUT type=hidden

      value=54 ln="1">

          <INPUT type=hidden value=0>

          </FONT></TD>

        <TD ln="1">

          <INPUT maxLength=10

      onkeyup=modifiedIt(this) size=10 ln="1">

        </TD>

        <TD ln="1">

          <INPUT maxLength=50

      onkeyup=modifiedIt(this) size=25 value="what do you think of it?"

    ln="1">

        </TD>

        <TD ln="1">

          <INPUT maxLength=100

      onkeyup=modifiedIt(this) size=58 value="like it?" ln="1">

        </TD>

      </TR>

      <TR bgColor=#e0e0e0 ln="2">

        <TD

    onmouseover=mouseOver() ln="2"><FONT size=2>

          <INPUT type=hidden

      value=55 ln="2">

          <INPUT type=hidden value=0>

          </FONT></TD>

        <TD ln="2">

          <INPUT maxLength=10

      onkeyup=modifiedIt(this) size=10 value=01/01/1999 ln="2">

        </TD>

        <TD ln="2">

          <INPUT maxLength=50

      onkeyup=modifiedIt(this) size=25 value="it`s a test" ln="2">

        </TD>

        <TD ln="2">

          <INPUT maxLength=100

      onkeyup=modifiedIt(this) size=58 value="how about it?" ln="2">

        </TD>

      </TR>

      <TR bgColor=#e0e0e0 ln="3">

        <TD

    onmouseover=mouseOver() ln="3"><FONT size=2>

          <INPUT type=hidden

      value=56 ln="3">

          <INPUT type=hidden value=0>

          </FONT></TD>

        <TD ln="3">

          <INPUT maxLength=10

      onkeyup=modifiedIt(this) size=10 value=02/01/2000 ln="3">

        </TD>

        <TD ln="3">

          <INPUT maxLength=50

      onkeyup=modifiedIt(this) size=25 value="another test" ln="3">

        </TD>

        <TD ln="3">

          <INPUT maxLength=100

      onkeyup=modifiedIt(this) size=58 ln="3">

        </TD>

      </TR>

      </TBODY>

    </TABLE>

    <SCRIPT>

allCount=4

</SCRIPT>

    <TABLE align=center border=1 borderColorDark=white borderColorLight=gray

cellPadding=1 cellSpacing=1 cols=4 rules=all width="100%"

nowrap>

      <TBODY>

      <TR>

        <TD align=middle

    onmouseout="this.className='controlPanel'"

    onmouseover="this.className='controlPanelMouseOver'"><FONT size=2>Add a New

          Record, click here</FONT></TD>

      </TR>

      </TBODY>

    </TABLE>

  </DIV>

</FORM>

</BODY>

</HTML>

  评论这张
 
阅读(466)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017