表單大全
1. 長度限制
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("不能超過50個字符!");
document.a.b.focus();
return false;
}
}
</script>
<form. name=a nsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></textarea>
<input type="submit" name="Submit" value="check">
</form>
sean 發表在 痞客邦 留言(0) 人氣(12)
<script language="javascript">
function go() {
x=document.getElementById("aaa")
if (x.innerHTML=='+')
{x.innerHTML='-'}
else
{x.innerHTML='+'}
}
sean 發表在 痞客邦 留言(0) 人氣(102)
Default text; this is the text that 3.x browsers will see. You can have lots of text here instead. Or, you can use a script to write in text only if it's Netscape 4 (you have to do that so that the layer gets some content or the written in text won't show correctly).
sean 發表在 痞客邦 留言(0) 人氣(11)