โค้ด: เลือกทั้งหมด
<script language="JavaScript">
function startCalc(){
calc();
}
function calc(){
maxSem1= document.autoSumForm.max1.value;
//2.3//
for(var count=1;count<=maxSem1;count++){
var b=document.getElementById('busimatter'+count);
var d=document.getElementById('detail'+count);
var t=document.getElementById('START'+count);
var s=document.getElementById('sumpoint'+count);
var to=document.getElementById('total23');
busimatter=b.value;
detail=d.value;
START=t.value;
sumpoint=s.value;
total23=to.value;
if(busimatter=='0' || detail=='' ||START==''){
sumpointvalue=0;
}else if(busimatter=='อาจารย์พิเศษตลอดภาค' || busimatter=='กรรมการ/ที่ปรึกษาองค์กรภายนอก' ||busimatter=='ประธานจัดโครงการเลี้ยงตนเอง'){
s.value=15;
}else if(busimatter=='อาจารย์พิเศษไม่ครบภาค'){
s.value=7.5;
}else if(busimatter=='วิทยากรภายนอก' || busimatter=='เลขาฯ/กรรมการจัดโครงการเลี้ยงตนเอง'){
s.value=10;
}else if(busimatter=='วิทยากรภายใน'){
s.value=5;
}
to.value=(total23*1)+(sumpoint*1);
if(to.value>30){
to.value=30;}
}
}//}}
function stopCalc(){
//clearInterval(interval);
}
</script>
อย่างให้มันเป็นอัตโมัต เวลาคลิกแล้วไม่เพิ่มค่าอะ