<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <script language="javascript"> function CreateNewRow() { var intLine = parseInt(document.frmMain.hdnMaxLine.value); intLine++; var theTable = document.all.tbExp //แทรกแถวที่ 1 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='ลำดับที่ '+intLine+'<div align="right">ชื่อยา : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<input type="text" name="textfield">' //แทรกแถวที่ 2 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='<div align="right">สรรพคุณ : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<textarea name="textarea"></textarea>' document.frmMain.hdnMaxLine.value = intLine; //แทรกแถวที่ 3 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='<div align="right">วิธีการใช้ยา : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<textarea name="textarea"></textarea>' document.frmMain.hdnMaxLine.value = intLine; //แทรกแถวที่ 4 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='<div align="right">จำนวน : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<input type="text" name="textfield2">' } function RemoveRow() { intLine = parseInt(document.frmMain.hdnMaxLine.value); if(parseInt(intLine) > 0) { theTable = (document.all) ? document.all.tbExp : document.getElementById("tbExp") theTableBody = theTable.tBodies[0]; theTableBody.deleteRow(intLine); intLine--; document.frmMain.hdnMaxLine.value = intLine; } } </script> <body Onload="CreateNewRow();"> <form name="frmMain" method="post"> <table width="445" border="1" id="tbExp"> </table> <input type="hidden" name="hdnMaxLine" value="0"> <input name="btnAdd" type="button" id="btnAdd" value="เพิ่มยา" onClick="CreateNewRow();"> <input name="btnDel" type="button" id="btnDel" value="ลบ" onClick="RemoveRow();"> </form> </body> </html>
<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <script language="javascript"> function CreateNewRow() { var intLine = parseInt(document.frmMain.hdnMaxLine.value); intLine++; var theTable = document.all.tbExp //แทรกแถวที่ 1 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='ลำดับที่ '+intLine+'<input name="btnDel" type="button" id="btnDel" value="ลบ" onClick="RemoveRow();"><div align="right">ชื่อยา :</div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<input type="text" name="med" id="med">' //แทรกแถวที่ 2 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='<div align="right">สรรพคุณ : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<textarea name="med_prop" id="med_prop"></textarea>' document.frmMain.hdnMaxLine.value = intLine; //แทรกแถวที่ 3 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='<div align="right">วิธีการใช้ยา : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<textarea name="med_use" id="med_use"></textarea>' document.frmMain.hdnMaxLine.value = intLine; //แทรกแถวที่ 4 var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML ='<div align="right">จำนวน : </div>' //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("className", "css-name"); newCell.innerHTML = '<input type="text" name="med_amount" id="med_amount">' } function RemoveRow() { intLine = parseInt(document.frmMain.hdnMaxLine.value); if(parseInt(intLine) > 0) { theTable = (document.all) ? document.all.tbExp : document.getElementById("tbExp") theTableBody = theTable.tBodies[0]; theTableBody.deleteRow(intLine); intLine--; document.frmMain.hdnMaxLine.value = intLine; } } </script> <body Onload="CreateNewRow();"> <form name="frmMain" method="post"> <table width="445" border="1" id="tbExp"> </table> <input type="hidden" name="hdnMaxLine" value="0"> <input name="btnAdd" type="button" id="btnAdd" value="เพิ่มยา" onClick="CreateNewRow();"> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง