没有值发送到$_POST['addEdit']
变量,请帮忙。
HTML code:
<form name='frm' method='POST' action=''>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr class="heading">
<td style="width:5px;"><input type="checkbox" name='check_all' onClick='checkAll();' /></td>
<td class="head">App Name</td>
.
.
<?php
//some embeded php (here is the addEdit component)
.
.
echo '
<td id="row_'.$row['id'].'" style="display: none;">
<input type="text" name="addEdit" id="addEdit_row_'.$row['id'].'" value="" size="4"/></td>
<td>
<input type="submit" name="add" value="A" onClick="addObs('.$row['id'].'); return false;"/>
';
</td>
.
.//end oh php code
?>
<!-- end of html code -->
PHP代码:
if(isset($_POST['add']))
{
//echo 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
if (isset($_POST['addEdit']))
{
echo 'post: '.$_POST['addEdit'];
}
}
答案 0 :(得分:2)
您是否关闭了<form>
代码?
尝试:
var_dump($_POST);
答案 1 :(得分:1)
尝试
<form name='frm' method='POST' action='<?php echo $_SERVER['PHP_SELF']?>'>