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 > สอบถามเรื่อง Enter แล้วไป Cell ถัดไปใน Add/Delete Multiple row หน่อยจร้า



 

สอบถามเรื่อง Enter แล้วไป Cell ถัดไปใน Add/Delete Multiple row หน่อยจร้า

 



Topic : 110754



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



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




พอดีว่า มีฟอร์มเป็นแบบ add/delete multiple row แล้วเวลาพิมพ์เสร็จ enterแล้วไปcellถัดไปอะคะ


Code (PHP)
function CreateNewRow()
	{
		var intLine = parseInt(document.frmMain.hdnMaxLine.value);
		intLine++;
			
		var theTable = document.getElementById("tbExp");
		var newRow = theTable.insertRow(theTable.rows.length)
              
		newRow.id = newRow.uniqueID

		var newCell
		
                //*** Column 7 ***//
		newCell = newRow.insertCell(0);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"CHECKBOX\"  SIZE=\"15\" NAME=\"chkbox_"+intLine+"\" ID=\"chkbox_"+intLine+"\" ></center>";
                
		//*** Column 1 ***//
		newCell = newRow.insertCell(1);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center>"+intLine+"</center>";

		//*** Column 2 ***//
		newCell = newRow.insertCell(2);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"materialcode_"+intLine+"\" ID=\"materialcode_"+intLine+"\"  VALUE=\"\"></center>";
		
		//*** Column 3 ***//
		newCell = newRow.insertCell(3);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"materialname_"+intLine+"\"  ID=\"materialname_"+intLine+"\" VALUE=\"\"></center>";
		
		//*** Column 4 ***//
		newCell = newRow.insertCell(4);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"locationrecieve_"+intLine+"\"  ID=\"locationrecieve_"+intLine+"\" VALUE=\"\"></center>";
                
                //*** Column 5 ***//
		newCell = newRow.insertCell(5);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"quantity_"+intLine+"\"  ID=\"quantity_"+intLine+"\" VALUE=\"\"></center>";
                
                //*** Column 6 ***//
		newCell = newRow.insertCell(6);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"25\" NAME=\"unit_"+intLine+"\"  ID=\"unit_"+intLine+"\" VALUE=\"\"></center>";
                
                
		

		//*** Create Option ***//
		//CreateSelectOption("Column5_"+intLine)
		
		document.frmMain.hdnMaxLine.value = intLine;
	}
	
	function RemoveRow()
	{
   
            var count_checked = $("input[type='checkbox']:checked").length; // count the checked
		if(count_checked == 0) {
			alert("Please select a product(s) to delete.");
			return false;
		}
		if(count_checked >=1) {
                    alert("You want to delete this product(s).");
                        $("input[name*='chkbox_']:checked").parents("tr").remove();
		} 
		  
	}  




Tag : PHP, JavaScript, jQuery







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2014-08-20 22:52:48 By : nornatt View : 630 Reply : 4
 

 

No. 1



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



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


เพิ่มเติม ในแต่ละcell เป็นแบบ autofill autocompleteด้วยจร้าา






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-08-20 23:05:11 By : nornatt
 


 

No. 2



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

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

Code (jQuery)
    <script type="text/javascript">
        $(function() {
            $('input:text:first').focus();
            var $inp = $('input:text');
            $inp.bind('keydown', function(e) {
                //var key = (e.keyCode ? e.keyCode : e.charCode);
                var key = e.which;
                if (key == 13) {
                    e.preventDefault();
                    var nxtIdx = $inp.index(this) + 1;
                    $(":input:text:eq(" + nxtIdx + ")").focus();
                }
            });
        });
    </script>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-08-21 09:26:08 By : mr.win
 

 

No. 3



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



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


ตอบความคิดเห็นที่ : 2 เขียนโดย : mr.win เมื่อวันที่ 2014-08-21 09:26:08
รายละเอียดของการตอบ ::
บางอันมันจะเป็น textarea กับ date และ number อะคะ คั้นระหว่าง input text จะเสริมเข้าไปได้ไหมอะคะ

พอแอดrowใหม่มา มันเข้าแค่cellแรกคะ cellถัดไปไม่ยอมเข้า



ประวัติการแก้ไข
2014-08-21 10:08:02
2014-08-21 13:55:50
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-08-21 10:06:49 By : nornatt
 


 

No. 4



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



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


ช่วยหน่อยนะคะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-08-21 13:56:18 By : nornatt
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สอบถามเรื่อง Enter แล้วไป Cell ถัดไปใน Add/Delete Multiple row หน่อยจร้า
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 00
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 อัตราราคา คลิกที่นี่