交流,学习,进步!

千里之行始于足下……
  博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

失去焦点时给textbox赋值(js)

Posted on 2006-12-22 08:57  xixi8820  阅读(3008)  评论(0编辑  收藏  举报
function setTextBoxValue()
  {
   var txtInPoint = document.getElementById("txtINPOINT_TextBox1"); 
   if(document.getElementById("notTxtHour_TextBox1").value.length=1)
   {
   document.getElementById("notTxtHour_TextBox1").value="0"+document.getElementById("notTxtHour_TextBox1").value;
   }
   txtInPoint.value = document.getElementById("notTxtHour_TextBox1").value+':'+document.getElementById("notTxtMinute_TextBox1").value+':'+document.getElementById("notTxtSecend_TextBox1").value+':'+document.getElementById("notTxtFrame_TextBox1").value;
  }


//////////////////////////////////////////////////////////////////////////////////////////////
   this.notTxtHour.Attributes.Add("onblur","setTextBoxValue();");
   this.notTxtMinute.Attributes.Add("onblur","setTextBoxValue();");
   this.notTxtSecend.Attributes.Add("onblur","setTextBoxValue();");
   this.notTxtFrame.Attributes.Add("onblur","setTextBoxValue();");