我有一个登陆页面,想在密码框里显示问题提示用户“ - 请输入密码”,但是密码框是不能显示明文的,所以用js 处理了下!<asp:TextBox ID="txtLoginPwd1" style="height:28px;width:202px;border:#868690 solid 1px;line-height:28px;" Text=" - 请输入密码" onFocus="ChangeUnameNonePwd();" runat="server" TextMode="SingleLine"></asp:TextBox>
<asp:TextBox ID="txtLoginPwd" style="height:28px;width:202px;border:#868690 solid 1px;line-height:28px;display:none;" onblur="ChangeUnameBlockPwd();" runat="server" TextMode="Password"></asp:TextBox>
//鼠标移上txtLoginPwd1隐藏txtLoginPwd1显示txtLoginPwd,并等到焦点
function ChangeUnameNonePwd() {
var inputname = document.getElementById("<%=txtLoginPwd.ClientID%>");
var inputname1 = document.getElementById("<%=txtLoginPwd1.ClientID%>");
inputname1.style.display = "none";
inputname.style.display = "block";
inputname.focus();
}
function ChangeUnameBlockPwd() {
var inputname = document.getElementById("<%=txtLoginPwd.ClientID%>");
var inputname1 = document.getElementById("<%=txtLoginPwd1.ClientID%>");
inputname.style.display = "none";
inputname1.style.display = "block";
}问题来了,IE6下无效,FF下,效果是出来了,可是当鼠标移到txtLoginPwd1上的时候,把txtLoginPwd显示出来了,但是位置比原来要上去一些!
不知道是什么原因!
请教各位大牛,有什么好的办法?
<asp:TextBox ID="txtLoginPwd" style="height:28px;width:202px;border:#868690 solid 1px;line-height:28px;display:none;" onblur="ChangeUnameBlockPwd();" runat="server" TextMode="Password"></asp:TextBox>
//鼠标移上txtLoginPwd1隐藏txtLoginPwd1显示txtLoginPwd,并等到焦点
function ChangeUnameNonePwd() {
var inputname = document.getElementById("<%=txtLoginPwd.ClientID%>");
var inputname1 = document.getElementById("<%=txtLoginPwd1.ClientID%>");
inputname1.style.display = "none";
inputname.style.display = "block";
inputname.focus();
}
function ChangeUnameBlockPwd() {
var inputname = document.getElementById("<%=txtLoginPwd.ClientID%>");
var inputname1 = document.getElementById("<%=txtLoginPwd1.ClientID%>");
inputname.style.display = "none";
inputname1.style.display = "block";
}问题来了,IE6下无效,FF下,效果是出来了,可是当鼠标移到txtLoginPwd1上的时候,把txtLoginPwd显示出来了,但是位置比原来要上去一些!
不知道是什么原因!
请教各位大牛,有什么好的办法?
解决方案 »
- 大家帮个忙分析下这段JQUERY代码的onclick为什么不起作用
- 接口System.Web.IHttpHandler必须要在asp.net4.0环境下实现吗
- 怎样从treeview上选择的节点后并导出数据
- 求一个SQL语句...谢谢!
- c# 动态转静态的问题
- 问关于弹出对话框的问题,在线等......
- .net 中session占用内存求解
- 怎样用vs2003开发asp.net网站
- 求DataList内部的DropDownList数据绑定方法的VB解决办法!
- 求教:在DropDwonList中,如果某个item的数据太长,如何实现在此控件中只显示一部分,当鼠标放上去时,在鼠标附近出现显示全部数据的消息
- GridView刷新问题
- ASP.NET 页面刷新!
function show()
{
var obj=document.getElementById("div1");
var offsetTop = document.documentElement.scrollTop + event.clientY + 15; var offsetLeft = event.clientX;
obj.style.top=offsetTop+"px";
obj.style.left=offsetLeft+"px";
obj.style.position="absolute";
obj.style.display="";
obj.style.width="130px";
obj.style.height="30px";
obj.innerText="";
}
function hide()
{
var obj=document.getElementById("div1");
obj.style.display="none";
}
<head>
<title></title>
<style type="text/css">
.tip{ background-image: url(http://www.guaik.com/i/bg/logo200712.gif)}
</style>
</head>
<body>
<input type="password" class="tip" style="height: 75px; width:200px;" onfocus="this.className='';" onblur="if( this.value == '') this.className='tip';" />
</body>
</html>