function textlistfix(){ //คำนวน A x B = C var hdnMaxLine=document.frmsavefix.hdnMaxLine alert("yyy"); function calA(i){ alert("xxx"); var d = function (){ alert("zzz"); //ตรงนี้แหละครับที่ไม่ยอมทำงาน ตรงจุดอื่น alert หมดยกเว้นตรงนี้ไม่รู้ว่าติดที่อะรไ } return d; } for(var i=0;i<hdnMaxLine.value;i++){ document.getElementById('txtlistunit'+i).onkeyup = calA(i); document.getElementById('txtlistprice'+i).onkeyup = calA(i); } } function CreateNewRow() { var intLine = parseInt(document.frmsavefix.hdnMaxLine.value); intLine++; var theTable = document.all.tbExp var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var item1 = 1 var newCell //*** Column 1 ลำดับ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center>"+intLine+"</center>" //*** Column 2 รายการ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><input type=\"text\" name=\"txtlistfix"+intLine+"\" id=\"txtlistfix"+intLine+"\" style=\"width:300px\"></center>" //*** Column 3 จำนวน***// newCell = newRow.insertCell(2) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><input type=\"text\" name=\"txtlistunit"+intLine+"\" id=\"txtlistunit"+intLine+"\" style=\"width:100px\" onKeyUp=\"textlistfix();\" ></center>" //*** Column 4 ราคา***// newCell = newRow.insertCell(3) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><input type=\"text\" name=\"txtlistprice"+intLine+"\" id=\"txtlistprice"+intLine+"\" style=\"width:100px\" onKeyUp=\"textlistfix();\" onKeyDown=\"textlistfix();\"></center>" //*** Column 5 ราคารวม***// newCell = newRow.insertCell(4) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><input type=\"text\" name=\"txtlisttotal"+intLine+"\" id=\"txtlisttotal"+intLine+"\" style=\"width:100px\"></center>" document.frmsavefix.hdnMaxLine.value = intLine; document.frmsavefix.hdnLine.value = intLine }
function calA(i){ alert("zzz"); }
for(var i=0;i<hdnMaxLine.value;i++){ document.getElementById('txtlistunit'+i).onkeyup = calA(i); document.getElementById('txtlistprice'+i).onkeyup = calA(i); }
for(var i=0;i<2;i++){ alert("111"); document.getElementById('txtlistunit'+i).onkeyup = calA(i); document.getElementById('txtlistprice'+i).onkeyup = calA(i); alert("222"); }
for(var i=0;i<2;i++){ alert("111"); document.getElementById('txtlistunit1').onkeyup = calA(i); //document.getElementById('txtlistprice'+i).onkeyup = calA(i); alert("222"); }
for(var i=1;i<=hdnMaxLine.value;i++){ process }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง