用户注册一项错误不能提交html,用户注册表单检测及错误提示代码

用户注册表单检测及错误提示代码 - www.webdm.cn

dl {

font:normal 12px/15px Arial;

position: relative;

width: 350px;

}

dt {

clear: both;

float:left;

width: 130px;

padding: 4px 0 2px 0;

text-align: left;

}

dd {

float: left;

width: 200px;

margin: 0 0 8px 0;

padding-left: 6px;

}

.hint {

display: none;

position: absolute;

right: -250px;

width: 200px;

margin-top: -4px;

border: 1px solid #c93;

padding: 10px 12px;

background: #ffc url("http://www.webdm.cn/images/20090924/pointer.gif") no-repeat -10px 5px;

}

.hint .hint-pointer {

position: absolute;

left: -10px;

top: 5px;

width: 10px;

height: 19px;

background: url("http://www.webdm.cn/images/20090924/pointer.gif") left top no-repeat;

}

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

if (inputs[i].parentNode.getElementsByTagName("span")[0]) {

inputs[i].onfocus = function () {

this.parentNode.getElementsByTagName("span")[0].style.display = "inline";

}

inputs[i].onblur = function () {

this.parentNode.getElementsByTagName("span")[0].style.display = "none";

}

}

}

var selects = document.getElementsByTagName("select");

for (var k=0; k

if (selects[k].parentNode.getElementsByTagName("span")[0]) {

selects[k].onfocus = function () {

this.parentNode.getElementsByTagName("span")[0].style.display = "inline";

}

selects[k].onblur = function () {

this.parentNode.getElementsByTagName("span")[0].style.display = "none";

}

}

}

}

addLoadEvent(prepareInputsForHints);

Tab or click through the fields to reveal the hints.

First Name:

This is the name your mama called you when you were little.

Last Name:

This is the name your sergeant called you when you went through bootcamp.

Email:

The thing with the @ symbol and the dot com at the end.

Birth Year:

YYYY

1066

1492

1776

Pick a famous year to be born in.

Username:

Between 4-12 characters.

Password:

Between 5-13 characters, but not 7. Never 7.

type="submit"

class="button"

value="Submit" />

网页代码站 - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值