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 > เวลากดเพิ่ม text Field 2แถว ระบุตำแหน่งยังไง ทำไมมันขึ้นล่างสุดของตาราง ช่วยแก้Codeหน่อย ผมอยากให้มันขึ้นติดจากที่กดเพิ่ม



 

เวลากดเพิ่ม text Field 2แถว ระบุตำแหน่งยังไง ทำไมมันขึ้นล่างสุดของตาราง ช่วยแก้Codeหน่อย ผมอยากให้มันขึ้นติดจากที่กดเพิ่ม

 



Topic : 127957



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



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




1



2


Code

Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript">
function CreateNewRow()
	{
		var intLine = parseInt(document.frmMain.hdnMaxLine.value);
		intLine++;
			
		var theTable = document.all.tbExp
		var newRow = theTable.insertRow(theTable.rows.length)
		newRow.id = newRow.uniqueID
		
		var item1 = 1
		var newCell
		
		newCell = newRow.insertCell(0)
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\"SIZE=\"25\" NAME=\"Column1_"+intLine+"\" VALUE=\"\"></center>"

		newCell = newRow.insertCell(1)
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\"SIZE=\"25\" NAME=\"Column2_"+intLine+"\" VALUE=\"\"></center>"				
		
		document.frmMain.hdnMaxLine.value = intLine;
	}
	
	function RemoveRow()
	{
		intLine = parseInt(document.frmMain.hdnMaxLine.value);
		if(parseInt(intLine) > 0)
		{
				theTable = (document.all) ? document.all.tbExp : 
				document.getElementById("tbExp")
				theTableBody = theTable.tBodies[0];
				theTableBody.deleteRow(intLine);
				intLine--;
				document.frmMain.hdnMaxLine.value = intLine;
		}	
	}	
</script>
</form>
<html>
<head>
<title>ฟอร์มรับข้อมูล</title>
</head>
<body>
<form id="form1" name="frmMain" method="post">
  <table width="813" border="1" id="tbExp">
    <tr>
<td width="138">VRF</td>
<td width="259"><input name="vrf" type="text" size="20" maxlength="20" id="vrf" /></td>
<td width="156">RD</td>
<td width="232"><input name="rd" type="text" size="20" maxlength="20" id="rd" /></td>
</tr>
<tr>
<td height="26">Interface</td>
<td><input name="interface" type="text" id="interface" size="20" maxlength="20" /></td>
<td>Vlan</td>
<td><input name="vlan" type="text" id="vlan" size="20" maxlength="20" /></td>
</tr>
<tr>
  <td height="26" bgcolor="#FFFFFF">Description</td>
  <td><input name="de2" type="text" id="de2" size="20" maxlength="20" /></td>
  <td>IP</td>
  <td><input name="ip" type="text" id="ip" size="20" maxlength="20" />
    <select name="subnet1" id="subnet1">
      <option>16</option>
      <option>17</option>
      <option>18</option>
      <option>19</option>
      <option>20</option>
      <option>21</option>
      <option>22</option>
      <option>23</option>
      <option value="0">24</option>
      <option value="128">25</option>
      <option value="192">26</option>
      <option value="224">27</option>
      <option value="240">28</option>
      <option value="248">29</option>
      <option value="252">30</option>
      <option value="254">31</option>
      <option value="255">32</option>
    </select></td>
</tr>
<tr>
  <td height="26">&nbsp;</td>
  <td><input name="df1" type="checkbox" id="df2" value="default-information originate" />
    <u id="df1">default-information originate</u></td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
</tr>
<tr>
  <td>Routing Protocal</td>
  <td colspan="3"><p>
    <input name="rdo1" type="radio"   value="static" onclick="{document.form1.action='static1.php'}javaScript:if(this.checked)
    {txt1.style.display='';}{txt2.style.display='';}{s.style.display='';}{s1.style.display='';}"/>
    Static</p>
    <p><span id="sta"></span>
      <input name="rdo1" type="radio"  value="eigrp" onclick="{document.form1.action='eigrp1.php'}javaScript:if(this.checked)
      {s1.style.display='';}{g1.style.display='';}{g2.style.display='';}{dm.style.display='';}{as.style.display='';}{txt1.style.display='none';}{txt2.style.display='none';}
      {s.style.display='none';}{s1.style.display='none';}"/> 
      eigrp
      </p>
    <p>
      <input name="rdo1" type="radio" value="N" onclick="javaScript:if(this.checked){txt1.style.display='none';}{txt2.style.display='none';}{s.style.display='none';}{s1.style.display='none';}
      {dm.style.display='none';}{as.style.display='none';}{g1.style.display='none';}{g2.style.display='none';}" />
      bgp</p></td>
  </tr>
<tr>
  <td height="37"><p><span id="s">IP LAN</span>&nbsp;</td>
  <td colspan="3"><input name="textfield" type="text" id="textfield2" size="25" />
    <span id="s1"> Description</span> 
    <input name="textfield2" type="text" id="textfield3" size="25" /> <input type="hidden" name="hdnMaxLine" value="0" />
    <input name="btnAdd" type="button" id="btnAdd" value="+" onclick="CreateNewRow();" />
    <input name="btnDel" type="button" id="btnDel" value="-" onclick="RemoveRow();" /></td>
  </tr>
<tr>
  <td height="37"><span id="g1">Default-metric</span>&nbsp;</td>
  <td><input type="text" name="dm" id="dm" /></td>
  <td><span id="g2">Autonomous-system</span>&nbsp;</td>
  <td><input type="text" name="as" id="as" /></td>
</tr>
</table>
</p>
<p>
   <input type="submit" name="submit" value="submit" />
</p>
</form>
</body>
</html>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2017-06-12 10:01:31 By : thanwa2 View : 719 Reply : 2
 

 

No. 1



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



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


ได้แล้วครับ ขอบคุณที่ช่วยตอบ






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


 

No. 2



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

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

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


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2017-06-14 11:04:36 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : เวลากดเพิ่ม text Field 2แถว ระบุตำแหน่งยังไง ทำไมมันขึ้นล่างสุดของตาราง ช่วยแก้Codeหน่อย ผมอยากให้มันขึ้นติดจากที่กดเพิ่ม
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 02
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 อัตราราคา คลิกที่นี่