[請益] 如何能將動態刪除的TEXT內容也刪除掉

看板PHP作者 (靜待時機)時間19年前 (2006/01/14 20:58), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/2 (看更多)
拜託大家 幫我一下 如何能將動態刪除的TEXT內容也刪除掉 謝謝 -- <script language="JavaScript"> function add(){ table1.insertRow().insertCell().innerHTML = "<input type='radio' name='tt'>"+table1.rows.length+"<input type='text' name='vote_select"+table1.rows.length+"' onchange='t_address();'>"; } function del(){ var c = document.getElementsByName('tt'); for(var i=0; i<c.length; i++) if(c[i].checked) table1.deleteRow(i); } function t_address(){ document.add2_form.tablet.value=table1.rows.length; } </script> <p> <form name="add2_form" method="post" action="vote_checkform5.php" onsubmit="return chk_data()"> <table border="0" cellspacing="1" cellpadding="4" align="center" id="table" bgcolor="darkgreen"> <tr bgcolor="Brow"> <td Colspan=2 align="center"><font size=5 color=white face="標楷題" >發表投 票議題</font></td></tr> <tr bgcolor="Aquamarine"> <td align="center">對象</td> <td><input type="radio" name="name" size=15 value="0">1 <input type="radio" name="name" size=15 value="1">3 <input type="radio" name="name" size=15 value="2">4 <input type="radio" name="name" size=15 value="3">5</td></tr> <tr bgcolor="Aquamarine"> <td align="center">標題 <td><input type="text" name="subject" size=25></td></tr> <tr bgcolor="Aquamarine" > <td align="center">選項 <td ><button onClick="add()">add</button> <button onClick="del()">del</button> <table border="1" id="table1" > </table> </td></tr> <tr bgcolor="Aquamarine"> <td align="center">公告時間 <td><input type="text" name="vote_start_time" size=15 value=<?php echo date("Y-m-dH:i:s")?> ></td></tr> <tr bgcolor="Aquamarine"> <td align="center">結束時間 <td><input type="text" name="vote_end_time" size=25 value="0000-00-00")></td></tr> </table> <br> <?php $a="table1.rows.length" ?> <input type="hidden" name="tablet"> <center><input type="submit" name="Submit" value="完成"> <input type="Reset" name="Reset" value="重新填寫"> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.21.245.154 ※ 編輯: kacloud 來自: 163.21.245.154 (01/14 21:00)

01/14 22:55, , 1F
你是說tt裡面的text?
01/14 22:55, 1F

01/15 23:02, , 2F
我發現問題不是在tt 而是在TEXT的編號 導致出現錯誤
01/15 23:02, 2F
文章代碼(AID): #13oFLbeA (PHP)
文章代碼(AID): #13oFLbeA (PHP)