|
<head>
<title>test</title>
<script language="Javascript" type="text/Javascript">
function validateLength(obj)
{
return obj.value.length < obj.getAttribute("maxlength");
}
</script>
</head>
<body>
<label for="userName">用戶名:</label>
<input id="userName" type="text" maxlength="10" onmouseover="this.focus();" onfocus="this.select();" /><br /><br />
<label for="passWord">密碼 :</label>
<input id="passWord" type="password" onmouseover="this.focus();" onfocus="this.select();" /><br /><br />
<label for="remark">備注 :</label>
<textarea id="remark" onkeypress="return validateLength(this);" onmouseover="this.focus();" onfocus="this.select();" maxlength="50" cols="50" rows="5"></textarea>
</body>
</html>
JavaScript技術(shù):javascript 表單的友好用戶體現(xiàn),轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。