求救!!!在密码框怎么显示提示文字啊? 我要在登录部分输入密码的文本框内有文字提示“6位数字”,用户点击文本框的时候可以输入密码,光标移出文本框的时候提示信息要再次显示。顺便提一下,我做的显示信息在密码框都是显示成×××××了。请大家帮忙解决一下啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果使用的是swing或者awt组件的话,可以使用"当前的文本框对象".setToolTipText("6位数字");如果是别的组件我没有试过,你自己可以尝试一下,希望你能够成功 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <script> function change(obj){ obj.style.display = "none"; if(obj.type=="text") document.getElementById('pass').style.display = "block"; else document.getElementById('txt').style.display = "block"; } </script> </HEAD> <BODY><input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px"> <input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"> <script> </script> </BODY></HTML> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <script> function change(obj){ obj.style.display = "none"; if(obj.type=="text") { document.getElementById('pass').style.display = "block"; document.getElementById('pass').focus();//加上 }else{ document.getElementById('txt').style.display = "block"; } } </script> </HEAD> <BODY><input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px"> <input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"> <script> </script> </BODY></HTML> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <script> function change(obj){ if(obj.type=="text"){ obj.style.display = "none"; document.getElementById('pass').style.display = "block"; document.getElementById('pass').value=""; document.getElementById('pass').focus();//加上 }else{ var pass = document.getElementById('pass').value; if(pass.length<1){ obj.style.display = "none"; document.getElementById('txt').style.display = "block"; } } } </script> </HEAD> <BODY><input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px"><input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"><script></script> </BODY></HTML> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <script> function change(obj){ obj.style.display = "none"; if(obj.type=="text") { document.getElementById('pass').style.display = "block"; document.getElementById('pass').focus();//加上 }else{ document.getElementById('txt').style.display = "block"; } } </script> </HEAD> <BODY><input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px"> <input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"> <script> </script> </BODY></HTML> LZ的目的是什么,按LZ这样的想法这样写密码还有什么意义吗?提交上去的值不管你输入什么密码都是"6位数字"了,你用隐藏域保存了密码信息? <HTML><HEAD><TITLE>ToolTip</TITLE> <script> function showToolTip(obj){ document.getElementById("tipform").style.display=""; } function hideToolTip(obj){ document.getElementById("tipform").style.display="none"; } </script></HEAD><BODY><input id="pass" type="password" value="" size=10 maxLength=6 onmouseout="hideToolTip(this)" onmouseover ="showToolTip(this)"> <div UNSELECTABLE="on" id="tipform" style="position:absolute;left:10;top:40;width:60px;background-color:#ffffC0; height:12px;z-index:1;display='none';">6位数字</div><script> </script> </BODY></HTML> 按楼主的要求,要反过来<HTML><HEAD><TITLE>ToolTip</TITLE> <script> function showToolTip(obj){ document.getElementById("tipform").style.display=""; } function hideToolTip(obj){ document.getElementById("tipform").style.display="none"; } </script></HEAD><BODY><input id="pass" type="password" value="" size=10 maxLength=6 onmouseout="showToolTip(this)" onmouseover ="hideToolTip(this)"> <div UNSELECTABLE="on" id="tipform" style="position:absolute;left:10;top:40;width:60px;background-color:#ffffC0; height:12px;z-index:1;display='';">6位数字</div><script> </script> </BODY></HTML> jsp中如何实现文件上传功能? java分布式,怎么实现? 绝对疑难杂症,高分请专家进! mysql的max_questions的问题 文件上传路径问题 一个很棘手的java web开发面试题 jsp urlrewriter 问题 如何获取视频文件第一桢图象 小弟,迷途,敢问谁做过对日外包? 求正则表示式去除html标签的样式保留img标签的src 求救:后台java解析xml文件把数据显示在jsp页面,如何对循环表单修改和增加??? java 运行环境的配置(jdk+resin)
如果是别的组件我没有试过,你自己可以尝试一下,希望你能够成功
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function change(obj){
obj.style.display = "none";
if(obj.type=="text")
document.getElementById('pass').style.display = "block";
else
document.getElementById('txt').style.display = "block";
}
</script>
</HEAD> <BODY>
<input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px">
<input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"> <script>
</script>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function change(obj){
obj.style.display = "none";
if(obj.type=="text") {
document.getElementById('pass').style.display = "block";
document.getElementById('pass').focus();//加上
}else{
document.getElementById('txt').style.display = "block";
}
}
</script>
</HEAD> <BODY>
<input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px">
<input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"> <script>
</script>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function change(obj){
if(obj.type=="text"){
obj.style.display = "none";
document.getElementById('pass').style.display = "block";
document.getElementById('pass').value="";
document.getElementById('pass').focus();//加上
}else{
var pass = document.getElementById('pass').value;
if(pass.length<1){
obj.style.display = "none";
document.getElementById('txt').style.display = "block";
}
}
}
</script>
</HEAD> <BODY>
<input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px">
<input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"><script>
</script>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function change(obj){
obj.style.display = "none";
if(obj.type=="text") {
document.getElementById('pass').style.display = "block";
document.getElementById('pass').focus();//加上
}else{
document.getElementById('txt').style.display = "block";
}
}
</script>
</HEAD> <BODY>
<input id="txt" type="text" value="6位数字" onfocus="change(this)" style="width:150px;height:20px">
<input id="pass" type="password" value="" style="display:none;width:150px;height:20px" onblur="change(this)"> <script>
</script>
</BODY>
</HTML>
"6位数字"了,你用隐藏域保存了密码信息?
<HTML>
<HEAD>
<TITLE>ToolTip</TITLE>
<script>
function showToolTip(obj){
document.getElementById("tipform").style.display="";
} function hideToolTip(obj){
document.getElementById("tipform").style.display="none";
}
</script>
</HEAD>
<BODY>
<input id="pass" type="password" value="" size=10 maxLength=6
onmouseout="hideToolTip(this)" onmouseover ="showToolTip(this)">
<div UNSELECTABLE="on" id="tipform"
style="position:absolute;left:10;top:40;width:60px;background-color:#ffffC0;
height:12px;z-index:1;display='none';">6位数字</div>
<script>
</script>
</BODY>
</HTML>
<HEAD>
<TITLE>ToolTip</TITLE>
<script>
function showToolTip(obj){
document.getElementById("tipform").style.display="";
} function hideToolTip(obj){
document.getElementById("tipform").style.display="none";
}
</script>
</HEAD>
<BODY>
<input id="pass" type="password" value="" size=10 maxLength=6
onmouseout="showToolTip(this)" onmouseover ="hideToolTip(this)">
<div UNSELECTABLE="on" id="tipform"
style="position:absolute;left:10;top:40;width:60px;background-color:#ffffC0;
height:12px;z-index:1;display='';">6位数字</div>
<script>
</script>
</BODY>
</HTML>