方案(一)
腳本
<script type=
//得到焦點時觸發事件
function onFocusFun(element
if (element
element
lor =
}
}
//離開輸入框時觸發事件
function onblurFun(element
if (element
lor =
element
}
}
</script>
調用示例
<tr align=
<td >
<span ><strong>用戶名:</strong></span><asp:textbox id=
OnFocus=
OnBlur=
<br />
<span ><strong>密 碼:</strong></span><asp:textbox id=
</td>
</tr>
方案(二)
[ 方法一]
前台代碼
<div>
<asp:TextBox ID=
<asp:TextBox ID=
<asp:Button ID=
</div>
後台代碼
using System;
using System
using System
using System
using System
using System
public partial class _Default : System
{
protected void Page_Load(object sender
{
//用戶輸入
txtName
txtName
txtName
//密碼輸入
txtPwd
txtPwd
txtPwd
//
if (!IsPostBack)
{
//內容
}
}
}
[ 方法二]
前台文本框裡添加下面
OnFocus=
OnBlur=
<asp:TextBox ID=
OnFocus=
OnBlur=
</asp:TextBox>
<asp:TextBox ID=
OnFocus=
OnBlur=
</asp:TextBox>
From:http://tw.wingwit.com/Article/program/net/201311/12418.html