//Created by Mr.Mongkon Kaenjan <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $('document').ready(function(){ $('#remove').hide(); $('#addrow').click(function(){ if(($('#tb tr').size()) > 1){ $('#remove').show(); } var no = parseInt($('#tb tr').length)+1; $('#tb tr:last').after( '<tr><td>'+no+'</td>'+ '<td><input type="text" id="txt" name="txt[]"></td>'+ '<td><select id="ddl" name="ddl[]">'+ '<option>--select one--</option>'+ '<option value="A">option A</option>'+ '<option value="B">option B</option>'+ '</select>'+ '</td></tr>' ); }); $('#remove').click(function(){ $('#tb tr:last').remove(); if(($('#tb tr').size())==1){ $('#remove').hide(); } }); }); </script> <table id="tb"> <tr> <td>1.</td> <td><input type="text" id="txt" name="txt[]"></td> <td> <select id="ddl" name="ddl[]"> <option>--select one--</option> <option value="A">option A</option> <option value="B">option B</option> </select> <button id="addrow">Add row</button><button id="remove">Remove</button></td> </tr> </table>
function CreateNewRow() { var intLine = parseInt(document.frmMain.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 = "<right><INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"Old_Company[]\" VALUE=\"\" class=\"input-medium\"style=\"text-align:center\" placeholder=\"ชื่อบริษัท\" ID=\"Co1_"+intLine+"\" ></right>" //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<right><INPUT TYPE=\"TEXT\" SIZE=\"15\" NAME=\"Old_positon[]\" VALUE=\"\" class=\"input-medium\"style=\"text-align:center\" placeholder=\"ตำแหน่ง\" ID=\"Co2_"+intLine+"\" ></right>" //*** Column 3 ***// newCell = newRow.insertCell(2) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><SELECT NAME=\"Old_Start[]\" ID=\"Co3_"+intLine+"\" class=\"input-small\"style=\"text-align:center\" ></SELECT></center>"; //*** Create Option ***// CreateSelectOption("Co3_"+intLine+"") //*** Column 4 ***// newCell = newRow.insertCell(3) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><SELECT NAME=\"Old_End[]\" class=\"input-small\"style=\"text-align:center\" ID=\"Co4_"+intLine+"\" ></SELECT></center>" //*** Create Option ***// CreateSelectOption1("Co4_"+intLine+"") //*** Column 5 ***// newCell = newRow.insertCell(4) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<right><INPUT TYPE=\"TEXT\" SIZE=\"13\" NAME=\"Old_Salary_Start[]\" VALUE=\"\" class=\"input-small\"style=\"text-align:center\" placeholder=\"เงินเดือนเริ่มต้น\" ID=\"Co5_"+intLine+"\" ></right>" //*** Column 6 ***// newCell = newRow.insertCell(5) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<right><INPUT TYPE=\"TEXT\" SIZE=\"13\" NAME=\"Old_Salary_End[]\" VALUE=\"\" class=\"input-small\"style=\"text-align:center\" placeholder=\"เงินเดือนเสุดท้าย\" ID=\"Co6_"+intLine+"\" ></right>" //*** Column 7 ***// newCell = newRow.insertCell(6) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<right><textarea NAME=\"Old_Why[]\" VALUE=\"\" class=\"input-medium\"style=\"text-align:center\" placeholder=\"สาเหตุที่ออก\"cols=\"20\" rows=\"2\"ID=\"Co7_"+intLine+"\" ></textarea></right>" document.frmMain.hdnMaxLine.value = intLine; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง