function CreateNewRow() { var intLine = parseInt(document.frmMain.hdnMaxLine.value); intLine++; var theTable = document.getElementById("tbExp"); var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 7 ***// newCell = newRow.insertCell(0); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"CHECKBOX\" SIZE=\"15\" NAME=\"chkbox_"+intLine+"\" ID=\"chkbox_"+intLine+"\" ></center>"; //*** Column 1 ***// newCell = newRow.insertCell(1); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center>"+intLine+"</center>"; //*** Column 2 ***// newCell = newRow.insertCell(2); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"materialcode_"+intLine+"\" ID=\"materialcode_"+intLine+"\" VALUE=\"\"></center>"; //*** Column 3 ***// newCell = newRow.insertCell(3); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"materialname_"+intLine+"\" ID=\"materialname_"+intLine+"\" VALUE=\"\"></center>"; //*** Column 4 ***// newCell = newRow.insertCell(4); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"locationrecieve_"+intLine+"\" ID=\"locationrecieve_"+intLine+"\" VALUE=\"\"></center>"; //*** Column 5 ***// newCell = newRow.insertCell(5); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"quantity_"+intLine+"\" ID=\"quantity_"+intLine+"\" VALUE=\"\"></center>"; //*** Column 6 ***// newCell = newRow.insertCell(6); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"unit_"+intLine+"\" ID=\"unit_"+intLine+"\" VALUE=\"\"></center>"; //*** Create Option ***// //CreateSelectOption("Column5_"+intLine) document.frmMain.hdnMaxLine.value = intLine; } function RemoveRow() { var count_checked = $("input[type='checkbox']:checked").length; // count the checked if(count_checked == 0) { alert("Please select a product(s) to delete."); return false; } if(count_checked >=1) { alert("You want to delete this product(s)."); $("input[name*='chkbox_']:checked").parents("tr").remove(); } }
<script type="text/javascript"> $(function() { $('input:text:first').focus(); var $inp = $('input:text'); $inp.bind('keydown', function(e) { //var key = (e.keyCode ? e.keyCode : e.charCode); var key = e.which; if (key == 13) { e.preventDefault(); var nxtIdx = $inp.index(this) + 1; $(":input:text:eq(" + nxtIdx + ")").focus(); } }); }); </script>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง