Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > [สอบถาม] เรื่องของ datepicker bootrap ครับ ใส่ใน textbox ที่เป็น dynamic ที่สามารำเพิ่มแถวได้ พอกดเพิ่มแถวแล้ว datepicker ไม่ทำงานครับ



 

[สอบถาม] เรื่องของ datepicker bootrap ครับ ใส่ใน textbox ที่เป็น dynamic ที่สามารำเพิ่มแถวได้ พอกดเพิ่มแถวแล้ว datepicker ไม่ทำงานครับ

 



Topic : 129376



โพสกระทู้ ( 262 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



ตามหัวรื่องเลยครับ พอดี ทำ datepicker bootrap ครับ ใส่ใน textbox ไว้ แล้วทำส่วนที่สามารำ เพิ่มแถวได้หลายๆ แถว พอกดเพิ่มแถวแล้ว datepicker ไม่ทำงาน แต่อันแรก แถวที่หนึ่งทำงานน่ะครับ ไม่ทราบว่าเป็นที่อะไรหรอครับ รบกวนช่วยชี้แนะด้วยครับ

ตามรูปแถวแรกยังทำทำงานได้อยู่

1


พอเพิ่มแถวสอง สคริปไม่ทำงานเลย

2



โค๊ด script ตัว dynamic เพิ่มแถวครับ
Code (JavaScript)
	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;
		
	}


โค๊ดตัว datepicker
Code (JavaScript)
$(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 ตัวตารางครับ

Code (PHP)
<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">




Tag : PHP, MySQL, HTML, jQuery, Bootstrap Framework, XAMPP









ประวัติการแก้ไข
2017-10-31 12:39:06
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2017-10-31 12:37:23 By : nutzaaclub View : 2410 Reply : 5
 

 

No. 1



โพสกระทู้ ( 83 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ผมไม่รู้เรื่องแต่ผมไม่เจอเข้าอยุ่ เว็บหนึงเลยขอแปะลิงค์ไว้ให้ละกันนะครับเพื่อมีประโยชน์ https://www.ninenik.com/%






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2017-10-31 16:28:25 By : PACKLpk
 


 

No. 2



โพสกระทู้ ( 262 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ยังไม่ได้ครับ ลบ ID ออกแล้วก็ยังไม่ได้
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2017-11-06 10:58:33 By : nutzaaclub
 

 

No. 3



โพสกระทู้ ( 1,636 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

Code (JavaScript)
  document.add_sch.hdlineTime.value = intLinetime;
  // เมื่อ add html ใหม่ ก็ต้องใส่ event ให้ด้วย
  $('#txtdatebegin"+intLinetime).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 เป็นปี พ.ศ.
  });
}

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2017-11-06 12:17:36 By : NewbiePHP
 


 

No. 4



โพสกระทู้ ( 50 )
บทความ ( 0 )



สถานะออฟไลน์


ผิดครับ ผมดูผิดเอง แหะๆ


ประวัติการแก้ไข
2017-11-06 14:27:08
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2017-11-06 14:25:58 By : ดินทราย
 


 

No. 5



โพสกระทู้ ( 50 )
บทความ ( 0 )



สถานะออฟไลน์


ลองแบบนี้ดูครับ
Code (JavaScript)
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;
	  	 $(".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 เป็นปี พ.ศ.
	});

	
}




ประวัติการแก้ไข
2017-11-07 11:00:21
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2017-11-06 22:34:44 By : ดินทราย
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : [สอบถาม] เรื่องของ datepicker bootrap ครับ ใส่ใน textbox ที่เป็น dynamic ที่สามารำเพิ่มแถวได้ พอกดเพิ่มแถวแล้ว datepicker ไม่ทำงานครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่