页面输入框自动提示问题......................在线等, 页面输入框自动提示功能怎么设置它显示或者不显示啊.... 我现在显示的位置跟输入框的位置相差很远,或者有什么解决办法,求解.... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Form Validation 没有用到什么js框架 就是服务器控件 TextBox 你用jquery的 autocomplete 有熟悉 整个系统都没用jquery 请大家不要往jquery那方面想 js验证<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Validation Hints</title><style type="text/css">body { margin:20px auto; width:700px;font-size:12px;color:#333;}a {FONT-SIZE: 12px; font-family: "微软雅黑"; font-weight:800; color:#FF3300;}form { width:500px; border:1px solid #ccc;}fieldset { border:0; padding:10px; margin:10px; position:relative;}label { display:block; font:normal 12px/17px verdana;}input {width:160px;}span.hint { font:normal 11px/14px verdana; background:#eee url(bg-span-hint-gray.gif) no-repeat top left; color:#444; border:1px solid #888; padding:5px 5px 5px 40px; width:250px; position:absolute; margin: -12px 0 0 14px; display:none;}fieldset.welldone span.hint { background:#9fd680 url(bg-span-hint-welldone.jpg) no-repeat top left; border-color:#749e5c; color:#000;}fieldset.kindagood span.hint { background:#ffffcc url(bg-span-hint-kindagood.jpg) no-repeat top left; border-color:#cc9933;}fieldset.welldone { background:transparent url(bg-fieldset-welldone.gif) no-repeat 194px 19px;}fieldset.kindagood { background:transparent url(bg-fieldset-kindagood.gif) no-repeat 194px 19px;}</style><script type="text/javascript">// This function checks if the username field// is at least 6 characters long.// If so, it attaches class="welldone" to the // containing fieldset.function checkUsernameForLength(whatYouTyped) { var fieldset = whatYouTyped.parentNode; var txt = whatYouTyped.value; if (txt.length > 2) { fieldset.className = "welldone"; } else { fieldset.className = ""; }}// If the password is at least 4 characters long, the containing // fieldset is assigned class="kindagood".// If it's at least 8 characters long, the containing// fieldset is assigned class="welldone", to give the user// the indication that they've selected a harder-to-crack// password.function checkPassword(whatYouTyped) { var fieldset = whatYouTyped.parentNode; var txt = whatYouTyped.value; if (txt.length > 3 && txt.length < 8) { fieldset.className = "kindagood"; } else if (txt.length > 7) { fieldset.className = "welldone"; } else { fieldset.className = ""; }}// This function checks the email address to be sure// it follows a certain pattern:// [email protected]// If so, it assigns class="welldone" to the containing// fieldset.function checkEmail(whatYouTyped) { var fieldset = whatYouTyped.parentNode; var txt = whatYouTyped.value; if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txt)) { fieldset.className = "welldone"; } else { fieldset.className = ""; }}// this part is for the form field hints to display// only on the condition that the text input has focus.// otherwise, it stays hidden.function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } }}function prepareInputsForHints() { var inputs = document.getElementsByTagName("input"); for (var i=0; i<inputs.length; i++){ inputs[i].onfocus = function () { this.parentNode.getElementsByTagName("span")[0].style.display = "inline"; } inputs[i].onblur = function () { this.parentNode.getElementsByTagName("span")[0].style.display = "none"; } }}addLoadEvent(prepareInputsForHints);</script></head><body><form action="#" name="basicform" id="basicform" ><fieldset> <label for="username">用 户 名:</label> <input type="text" id="username" onkeyup="checkUsernameForLength(this);" /> <span class="hint">昵称长度需大于3个字符,请使用英文字母、符号或数字.</span></fieldset><fieldset> <label for="password">密 码:</label> <input type="password" id="password" onkeyup="checkPassword(this);" /> <span class="hint">密码长度需大于4个字符,可使用任意字符,建议使用8个字符.</span></fieldset><fieldset> <label for="email">电子邮件:</label> <input type="text" id="email" onkeyup="checkEmail(this);" /> <span class="hint">用来确认您的会员身份,维奇网绝不会公开此信息!</span></fieldset></form><center><br /></center></body></html> http://www.cnblogs.com/wangbin_ben/archive/2010/08/06/1793765.htmlhttp://blog.csdn.net/zhuzhao/article/details/3686061参考下 textBox的AutoCompleteType属性设置成Disabled 怎么用DataTable.Compute(expression ,filter)计算列的总和,急急急急急急,在线等============== Ajaxpro问题 传值问题 Access 更新后马上获取居然是缓存中的数据,怎么办? 新手建的群,望大家参与 17366995 求net2.0链接sql2005的web.config的字符串写法 DataGrid更新问题 水晶报表问题:如何设置打印时的纸张格式为横的? 框架的问题,各位高手请帮帮忙忙,在线等…… c#怎么判断input里不能全为空格 新手求指教 谢谢 未安装全文搜索或无法加载某一全文组件。 高手请教 关于分页存储过程
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Validation Hints</title><style type="text/css">
body { margin:20px auto; width:700px;font-size:12px;color:#333;}
a {FONT-SIZE: 12px; font-family: "微软雅黑"; font-weight:800; color:#FF3300;}form {
width:500px;
border:1px solid #ccc;
}
fieldset {
border:0;
padding:10px;
margin:10px;
position:relative;
}
label {
display:block;
font:normal 12px/17px verdana;
}
input {width:160px;}
span.hint {
font:normal 11px/14px verdana;
background:#eee url(bg-span-hint-gray.gif) no-repeat top left;
color:#444;
border:1px solid #888;
padding:5px 5px 5px 40px;
width:250px;
position:absolute;
margin: -12px 0 0 14px;
display:none;
}
fieldset.welldone span.hint {
background:#9fd680 url(bg-span-hint-welldone.jpg) no-repeat top left;
border-color:#749e5c;
color:#000;
}
fieldset.kindagood span.hint {
background:#ffffcc url(bg-span-hint-kindagood.jpg) no-repeat top left;
border-color:#cc9933;
}
fieldset.welldone {
background:transparent url(bg-fieldset-welldone.gif) no-repeat 194px 19px;
}
fieldset.kindagood {
background:transparent url(bg-fieldset-kindagood.gif) no-repeat 194px 19px;
}
</style><script type="text/javascript">// This function checks if the username field
// is at least 6 characters long.
// If so, it attaches class="welldone" to the
// containing fieldset.function checkUsernameForLength(whatYouTyped) {
var fieldset = whatYouTyped.parentNode;
var txt = whatYouTyped.value;
if (txt.length > 2) {
fieldset.className = "welldone";
}
else {
fieldset.className = "";
}
}// If the password is at least 4 characters long, the containing
// fieldset is assigned class="kindagood".
// If it's at least 8 characters long, the containing
// fieldset is assigned class="welldone", to give the user
// the indication that they've selected a harder-to-crack
// password.function checkPassword(whatYouTyped) {
var fieldset = whatYouTyped.parentNode;
var txt = whatYouTyped.value;
if (txt.length > 3 && txt.length < 8) {
fieldset.className = "kindagood";
} else if (txt.length > 7) {
fieldset.className = "welldone";
} else {
fieldset.className = "";
}
}// This function checks the email address to be sure
// it follows a certain pattern:
// [email protected]
// If so, it assigns class="welldone" to the containing
// fieldset.function checkEmail(whatYouTyped) {
var fieldset = whatYouTyped.parentNode;
var txt = whatYouTyped.value;
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txt)) {
fieldset.className = "welldone";
} else {
fieldset.className = "";
}
}
// this part is for the form field hints to display
// only on the condition that the text input has focus.
// otherwise, it stays hidden.function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
function prepareInputsForHints() {
var inputs = document.getElementsByTagName("input");
for (var i=0; i<inputs.length; i++){
inputs[i].onfocus = function () {
this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
}
inputs[i].onblur = function () {
this.parentNode.getElementsByTagName("span")[0].style.display = "none";
}
}
}
addLoadEvent(prepareInputsForHints);</script>
</head>
<body><form
action="#"
name="basicform"
id="basicform" ><fieldset>
<label for="username">用 户 名:</label>
<input
type="text"
id="username"
onkeyup="checkUsernameForLength(this);" />
<span class="hint">昵称长度需大于3个字符,请使用英文字母、符号或数字.</span>
</fieldset><fieldset>
<label for="password">密 码:</label>
<input
type="password"
id="password"
onkeyup="checkPassword(this);" />
<span class="hint">密码长度需大于4个字符,可使用任意字符,建议使用8个字符.</span>
</fieldset><fieldset>
<label for="email">电子邮件:</label>
<input
type="text"
id="email"
onkeyup="checkEmail(this);" />
<span class="hint">用来确认您的会员身份,维奇网绝不会公开此信息!</span>
</fieldset></form>
<center><br />
</center>
</body>
</html>
http://blog.csdn.net/zhuzhao/article/details/3686061
参考下