ช่วยทีครับ ผม clone() แล้ว count โผล่แค่ 1 ครับ $(function(){ $(#addRow).click(function(){ $(#tbl1).append($(#firstTR).clone()); }); $(#removeRow).click(function(){

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ช่วยทีครับ ผม clone() แล้ว count โผล่แค่ 1 ครับ $(function(){ $(#addRow).click(function(){ $(#tbl1).append($(#firstTR).clone()); }); $(#removeRow).click(function(){

ช่วยทีครับ ผม clone() แล้ว count โผล่แค่ 1 ครับ $(function(){ $(#addRow).click(function(){ $(#tbl1).append($(#firstTR).clone()); }); $(#removeRow).click(function(){
อันนี้ตัว code ที่ clone ครับ
          

                        $("#addRow").click(function(){
                            $("#tbl1").append($("#firstTR").clone());
						});
							$("#removeRow").click(function(){
								if($("#tbl1 tr").size()>1){
									$("#tbl1 tr:last").remove();
								}else{
									alert("ต้องมีรายการข้อมูลอย่างน้อย 1 รายการ");
								}
							});	                    
						});
ส่วนอันนี้คือตัวที่ผมจะ clone คับ

<table width="100%" border="0" cellspacing="0" cellpadding="4" class="main" id="tbl1">
							<tr>
								<td width="176" rowspan="2" align="center" class="border_4">Academy</td>
								<td rowspan="2" colspan="2" align="center" class="border_4">Degree</td>
								<td colspan="2" align="center" class="border_4">Year Att</td>
								<td width="57" rowspan="2" align="center" class="border_4">GPA.</td>
							</tr>
							<tr>
								<td width="135" align="center" class="border_2 border_4">start</td>
								<td width="128" align="center" class="border_2 border_4"><pre>graduate</pre></td>
							</tr>
							<tr id="firstTR" align="center">
								<td class="border_2 border_4"><input type="text"   name="academy[]" class="main" style="width:150px;" /></td>
								<td width="152" class="border_2 border_4"><span class="border_4">
						    <select   name="degree[]" class="style7" style="width:150px;">
									  <?
                                      $sel7="select * from degree  ";
                                      $que7=mysql_query($sel7);
                                      while($read7=mysql_fetch_array($que7)){
                                      ?>
                                      <option value="<?=$read7['deg_id'];?>"><?=$read7['deg_desc'];?></option>
                                      <? } ?>
							    </select>
								</span></td>
								<td width="150" class="border_2 border_4"><input type="test" name="degreedesc[]" class="main" style="width:150px;" /></td>
								<td class="border_2 border_4"><span class="border_2 border_4">
								  <input type="month" name="start[]" class="main" style="width:120px;" />
								</span></td>
								<td class="border_2 border_4"><span class="border_2 border_4">
								  <input type="month" name="graduate[]" class="main" style="width:120px;" />
								</span>&nbsp;</td>
								<td class="border_2"><input type="text"   name="gpa[]" style="width:50px;"/>&nbsp;</td>
							</tr>
						</table>

แล้วมันก็ clone ได้ครับ แต่ปัญหาคือผมลอง count ตอนที่ส่งค่าไปอีกหน้านึงดู
ผม echo count($_POST[academy]); ดูมันออกแค่ 1 อ่าครับผม  ผมต้องทำไงดีครับ ขอรบกวนด้วยครับพี่ ผมมือใหม่จริงๆครับ T^T


Booster 183.89.61.xxx 01-12-2014 06:16:49

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1
  ลอง print_r ดูว่ามีการส่งค่าไปจริงไหม

<pre>
<?php print_r($_POST); ?>
</pre>


ninenik 171.96.19.xxx 01-12-2014
 ความคิดเห็นที่ 2

มันมาแค่ค่าแรกค่าเดียวครับพี่ 

ผมลองทดสอบ แอดเพิ่มอีก 2 บรรทัด แล้วใส่ 111,2222,333 ไปครับ

ปรากฏว่า print_r ออกมาแค่ Array ( [0] => 111) ครับ อีก 2 ตัวไม่มาครับพี่ 



booster 183.89.224.xxx 01-12-2014 17:30






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ