<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <script language="javascript"> function CreateNewRow() { var intLine = parseInt(document.frmMain.hdnMaxLine.value); var myLine = document.getElementById('hdnLine'); 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("type", "text"); newCell.style.cssText= 'text-align:center;'; newCell.innerHTML = intLine; //*** Column 2 ***// newCell = newRow.insertCell(1) newCell.id = newCell.uniqueID newCell.setAttribute("type", "text"); newCell.setAttribute("name", "choice"+intLine); newCell.innerHTML = "<INPUT TYPE=\"TEXT\" SIZE=\"25\" CLASS=\"form-control\" NAME=\"choice"+intLine+"\" ID=\"choice"+intLine+"\" VALUE=\"\" placeholder=\"ตัวเลือกที่"+intLine+"\">" //*** Column 3 ***// newCell = newRow.insertCell(2) newCell.id = newCell.uniqueID newCell.setAttribute("name", "check"+intLine); newCell.innerHTML = "<CENTER><INPUT TYPE=\"radio\" SIZE=\"20\" NAME=\"check"+intLine+"\" ID=\"check"+intLine+"\" VALUE=\"1\"></CENTER>" document.frmMain.hdnMaxLine.value = intLine; } function RemoveRow() { intLine = parseInt(document.frmMain.hdnMaxLine.value); var myLine = document.getElementById('hdnLine'); if(parseInt(intLine) > 1) { 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" class="form-horizontal" action="multi_choice_save.php?Subject_ID=<?=$Subject_ID;?>&& Subject_Name=<?=$Subject_Name;?>&&Quiz_ID=<?=$Quiz_ID;?>&&nameQuiz=<?=$nameQuiz;?>&&Type_ID=3"> <!--คำถาม--> <div class="form-group"> <label class="control-label col-sm-2">คำถาม :</label> <div class="col-sm-7"> <?php include 'textarea_edit.php';?> </div> </div> <!--คะแนน--> <div class="form-group"> <label class="control-label col-sm-2">คะแนน :</label> <div class="col-sm-3"> <input type="number" class="form-control" id="Mark" placeholder="กรอกคะแนน" name="Mark" required="" min="-100" max="100" step="0.5" value="<?php echo $Mark?>"> </div><br><br> </div> <table width="445" id="tbExp"> <tr> <td><div align="center">คำตอบที่ </div></td> <td><div align="center">คำตอบ </div></td> <td><div align="center"> </div></td> </tr> <tr> <script type="text/javascript">CreateNewRow()</script> </tr> </table> <input type="hidden" name="hdnMaxLine" value="0"> <input name="btnAdd" type="button" id="btnAdd" value="+" class="btn btn-info btn-circle" onClick="CreateNewRow();"> <input name="btnDel" type="button" id="btnDel" value="-" class="btn btn-danger btn-circle" onClick="RemoveRow();"> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default" name="Add" id="Add" value="Add">บันทึก</button> <a href="exam.php?Subject_ID=<?=$Subject_ID;?>&& Subject_Name=<?=$Subject_Name;?>&&Quiz_ID=<?=$Quiz_ID;?>&&nameQuiz=<?=$nameQuiz;?>" class="btn btn-default">ยกเลิก</a> </div> </div> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง