嗨,我通过 jquery 将列附加到一行。我有一排看起来像这样
<form action="certifications.php?action=addnew_save" method="post">
<tr id="add_new_<?php echo($v_id);?>" valign="top" bgcolor="#EEEEEE"></tr>
</form>
现在我在做什么,我将一些附加<td>
到这一行。我的 javascript 函数看起来像这样
var sr=document.getElementById('hidden_'+vid).value;
var append='';
append+='<td width="40" align="center">'+sr+'</td>';
append+='<input type="hidden" value="'+vid+'">';
append+='<td width="200" align="center"><input type="text" name="short_name" size="25" autocomplete="off" value="" /></td>';
append+='<td width="200" align="center"><input type="text" name="full_name" size="25" autocomplete="off" value="" /></td>';
append+='<td width="80" align="center"></td>';
append+='<td width="80" align="center"><input type="checkbox" name="feature" /></td>';
append+='<td width="80" align="center"><input type="text" name="order" size="2" value="" /></td>';
append+='<td width="80" align="center"><input type="checkbox" name="hidden" /></td>';
append+='<td width="80" align="center"></td>';
append+='<td width="50" class="style3" align="center"></td>';
append+='<td width="50" class="style3" align="center"><INPUT TYPE="submit" VALUE="Submit" NAME="Submit"></td>';
append+='<td width="50" class="style3" align="center"><a href="certifications.php?action=delete&id="onclick="if(confirm(\'Are you sure you want to Delete it ?\')){return true;}else{return false;}" >Delete</a></td>';
append+='<td width="80" align="center"></td>';
jQuery('#add_new_'+vid).append(append);
列已附加,但问题在于form
标签。从我的代码中,我希望附加 html 后应该是这样的
<form action="certifications.php?action=addnew_save" method="post">
<tr id="add_new_<?php echo($v_id);?>" valign="top" bgcolor="#EEEEEE">
<td widht="40">Value</td>
Other tds
.
.
.
.
</tr>
</form>
但我得到了上面的表单标签<tr>
,它看起来像这样
<form action="certifications.php?action=addnew_save" method="post">
</form>
<tr>
my <td>
</tr>
追加有什么问题?为什么表单标签总是在上面