我有一行id聯繫人列表。我想在按鈕點擊事件的基礎上再添加兩行(追加到)。我有id addmorecontacts的按鈕。在表格上添加更多行按鈕點擊事件表單
我的代碼結構...
<?php $contacts=mysql_query("SELECT cntctnum, cntcttype FROM contacts WHERE rfrnc='".$pgid."'") or die(mysql_error());
while ($resultcontacts=mysql_fetch_assoc($contacts)) {
$contactnumber = explode("-", $resultcontacts["cntctnum"]); ?>
<tr >
<td class="spacing1">Contact Number:</td>
<td class="spacing1" >
<input type="text" id="a" tabindex="5" name="txtphone" value="<?php echo $contactnumber[0]; ?>" onKeyUp="next()" onChange="change2()" class="a" maxlength="3" size="2"/>
<b>-</b>
<input type="text" id="b" name="txtphone1" tabindex="6" value="<?php echo $contactnumber[1]; ?>" onKeyUp="next(); next2()" onChange="change2()" class="a" maxlength="3" size="2"/>
<b>-</b>
<input type="text" id="c" name="txtphone2" tabindex="7" value="<?php echo $contactnumber[2]; ?>" onKeyUp="next1()" onChange="change2()" class="a" maxlength="4" size="3"/></td>
</tr>
<tr id="contactlist">
<td class="spacing1" >Contact Type:</td>
<td class="spacing1" ><select name="cntcttype" id="cntcttype" tabindex="8" class="select" onChange="change2()">
<?php getcontacttype($resultcontacts["cntcttype"]); ?>
</select></td>
</tr>
<?php } ?>
我布頓行...
<tr>
<td class="spacing1" > </td>
<td class="spacing1" > </td>
<td class="spacing1" ><input name="addmorecontacts" type="button" value="Add More"></td>
</tr>
請解釋一下你的問題。 –
我的意思是我必須在此行的聯繫號碼和聯繫類型onclick這個按鈕下面添加更多的行。 –