checkbox 全選

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

checkbox 全選

文章 yehlu »

<script>
function checkAll(field) {
var i;
if (this.document.form.elements[field][0].checked == true){
for (i = 0; i < this.document.form.elements[field].length; i++) this.document.form.elements[field].checked = false;
}else{
for (i = 0; i < this.document.form.elements[field].length; i++) this.document.form.elements[field].checked = true;
}
}
</script>


$form->button("selectasll","全選/取消全選","checkAll('goods_tran_ida[]')");
回覆文章

回到「Java Script」