好吧,试着解释一下。我有一张桌子:
<tr>
<td>Some specific question 1</td>
<td><input type="radio" name="v29" value="Some specific question: standart answer 1" checked="" >Standart answer 1<br>
<input type="radio" name="v29" value="Some specific question: standart answer 2">Standart answer 2<br>
<input type="radio" name="v29">or print your answer<br>
<textarea name="v29" cols="50" placeholder="Enter text here" ></textarea></td>
</tr>
<tr>
<td>Some specific question 2</td>
<td><input type="radio" name="v30" value="Some specific question: standart answer 1" checked="" >Standart answer 1<br>
<input type="radio" name="v30" value="Some specific question: standart answer 2">Standart answer 2<br>
<input type="radio" name="v30">or print your answer<br>
<textarea name="v30" cols="50" placeholder="Enter text here" ></textarea></td>
</tr>
<tr>
<td>Some specific question 3</td>
<td><input type="radio" name="v31" value="Some specific question: standart answer 1" checked="" >Standart answer 1<br>
<input type="radio" name="v31" value="Some specific question: standart answer 2">Standart answer 2<br>
<input type="radio" name="v31">or print your answer<br>
<textarea name="v31" cols="50" placeholder="Enter text here" ></textarea></td>
</tr>
<input type="submit" name="submitgop" style="margin-right:7px; margin-left:7px;" value="Save">
“submitgop”按钮开始这个:
foreach ($_POST as $key => $value) {
$answerText[$i] = $value;
$i++;
}
前两个按钮将从表中返回完美的“问题:答案”对。但是当用户选择第三个按钮时,它只会返回“答案”。我想修复它,并以某种方式将“问题:”添加到第三个按钮(即 textarea)的值中。