สอบถามเรื่อง datepicker bootrap ใส่ใน textbox ที่สามารถเพิ่มแถวได้ พอกดเพิ่มแถวแล้ว sricpt ไม่ทำงานครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา สอบถามเรื่อง datepicker bootrap ใส่ใน textbox ที่สามารถเพิ่มแถวได้ พอกดเพิ่มแถวแล้ว sricpt ไม่ทำงานครับ
สอบถามเรื่อง datepicker bootrap ใส่ใน textbox ที่สามารถเพิ่มแถวได้ พอกดเพิ่มแถวแล้ว sricpt ไม่ทำงานครับ
Copy
ตามหัวรื่องเลยครับ พอดี ทำ datepicker bootrap ครับ ใส่ใน textbox ไว้ แล้วทำส่วนที่สามารำ เพิ่มแถวได้หลายๆ แถว พอกดเพิ่มแถวแล้ว datepicker ไม่ทำงาน แต่อันแรก แถวที่หนึ่งทำงานน่ะครับ ไม่ทราบว่าเป็นที่อะไรหรอครับ รบกวนช่วยชี้แนะด้วยครับ
ทำตาม กระทู้นี้แล้วไม่หายครับ link
ตามรูปแถวแรกยังทำทำงานได้อยู่
พอเพิ่มแถวสอง สคริปไม่ทำงานเลย
โค๊ดคัวเพิ่มแถว
function CreateNewRowTime() { var intLinetime = parseInt(document.add_sch.hdlineTime.value); //alert(intLinetime); intLinetime++; var theTable = document.getElementById("tblTime"); 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>"+intLinetime+".</center>"; //*** Column 2 ***// newCell = newRow.insertCell(1); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<input name='txtdatebegin"+intLinetime+"' type='text' id='txtdatebegin"+intLinetime+"' class='timetable' />"; //*** Column 3 ***// newCell = newRow.insertCell(2); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<select name="selTime"+intLinetime+"" id="selTime"+intLinetime+"" class="form-control"></select>"; CreateSelectTime("selTime"+intLinetime) document.add_sch.hdlineTime.value = intLinetime;
}
โค๊ดคัว datepickter $(document).ready(function(){ $(".timetable").datepicker({ format: 'dd/mm/yyyy', autoclose: true, orientation: "bottom auto", todayHighlight: true, todayBtn: true, language: 'th',//เปลี่ยน label ต่างของ ปฏิทิน ให้เป็น ภาษาไทย (ต้องใช้ไฟล์ bootstrap-datepicker.th.min.js นี้ด้วย) thaiyear: true//Set เป็นปี พ.ศ. });
});
โค๊ด html ตัวตารางครับ
<table id="tblTime"> <tr> <td align="right"> <input name="btnAddTime" type="button" id="btnAddTime" value="+" class="btn btn-success btn-sm" onClick="CreateNewRowTime();"> <input name="btnDelTime" type="button" id="btnDelTime" value="-" class="btn btn-danger btn-sm" onClick="RemoveRowTime();"></td> </tr> </table> <input type="hidden" name="hdlineTime" id="hdlineTime" value="0" class="form-control">
Nutzaaclub
1.46.79.xxx
06-11-2017
10:50:42
คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา
โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ