<SCRIPT Language="JavaScript"> function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function startCalc(row) { interval = setInterval("calc('"+row+"')",1); } function calc(row) { var txtprice = document.forms['autoSumForm'].elements['price[]']; var txtamount = document.forms['autoSumForm'].elements['amount[]']; var txttotal = document.forms['autoSumForm'].elements['total[]']; var lentxt3 = txtamount.length; var result3 = (txtamount[row].value * 1) ; txtamount[row].value =result3 ; var total3 = 0; for(var i3=0; i3 < lentxt3; i3++) { txttotal[i3].value = addCommas((txtprice[i3].value*1)*(txtamount[i3].value*1).toFixed(2)); } } </SCRIPT>
function calc(row) { var txtprice = document.forms['autoSumForm'].elements['price[]']; var txtamount = document.forms['autoSumForm'].elements['amount[]']; var txttotal = document.forms['autoSumForm'].elements['total[]']; var lentxt3 = txtamount.length; var result3 = (txtamount[row].value * 1) ; txtamount[row].value =result3 ; var total3 = 0; for(var i3=0; i3 < lentxt3; i3++) { txttotal[i3].value = addCommas((txtprice[i3].value*1)+(txtamount[i3].value*1).toFixed(2)); } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง