<? require('conn_mysql.php'); $strSQL = "SELECT * FROM owner order by id_owner"; $objQuery = mysql_query($strSQL); ?> <script language="javascript"> function CreateSelectOption(ele) { var objSelect = document.getElementById(ele); var Item = new Option("", ""); objSelect.options[objSelect.length] = Item; <? while($objResult = mysql_fetch_array($objQuery)) { ?> var Item = new Option("<?=$objResult["id_owner"];?>", "<?=$objResult["id_owner"];?>"); objSelect.options[objSelect.length] = Item; <? } ?> } 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 newCell //*** Column 1 ***// newCell = newRow.insertCell(0); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><SELECT NAME=\"Column0_"+intLine+"\"></SELECT></center>"; onchange="show(this.value);" //*** Create Option ***// CreateSelectOption("Column0_"+intLine) //*** Column 2 ***// newCell = newRow.insertCell(1); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"Column1_"+intLine+"\" VALUE=\"\"></center>"; //*** Column 3 ***// newCell = newRow.insertCell(2); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"30\" NAME=\"Column2_"+intLine+"\" VALUE=\"\"></center>"; document.frmMain.hdnMaxLine.value = intLine; } 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> <form name="frmMain" method="post" action="user_work3_1.php"> <table width="445" border="0" id="tbExp" align="center"> <tr> <td height="29" valign="top"><div align="center" class="fonttable">รหัสนักศึกษา </div></td> <td valign="top"><div align="center" class="fonttable">ชื่อนักศึกษา </div></td> <td valign="top"><div align="center" class="fonttable">นามสกุลนักศึกษา </div></td> </tr> </table> <input type="hidden" name="hdnMaxLine" value="0"> <? echo"<p class=\"style4\"><br><center>กรุณากด ปุ่ม + เพื่อเพิ่ม เจ้าของผลงาน </p>"; ?> <input name="btnAdd" type="button" class="btn" id="btnAdd" onClick="CreateNewRow();" value=" + "> <input name="btnDel" type="button" class="btn" id="btnDel" onClick="RemoveRow();" value=" - "> <? echo"</center>"; ?> <input name="btnSubmit" type="submit" class="style3" value="NEXT"> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง