验证所有文本框都有值后激活按钮
本文发布于 16 年前,部分内容可能已经失去参考价值。
代码:
<script>
function check(){
s.disabled = (t1.value == '' || t2.value == '' || t3.value == '')
}
</script>
<input name="t1" onpropertychange="check();">
<input name="t2" onpropertychange="check();">
<input name="t3" onpropertychange="check();">
<input type="submit" name="s" disabled>
function check(){
s.disabled = (t1.value == '' || t2.value == '' || t3.value == '')
}
</script>
<input name="t1" onpropertychange="check();">
<input name="t2" onpropertychange="check();">
<input name="t3" onpropertychange="check();">
<input type="submit" name="s" disabled>
效果:
可能相关的内容