我在提交表单时尝试输入 textarea 标签:
I'm trying to input a textarea tag when I submit my form:
<textarea id="confirmationText" class="text" cols="86" rows ="20" name="confirmationText" form="confirmationForm"></textarea> <form action="sendConfirmation.php" name="confirmationForm" method="post"> <input type="submit" value="Email" class="submitButton"> </form>如您所见,我已在 textarea 标记中设置了 form="confirmationForm" 属性.我已经使用 Live HTTP Headers 来捕获 POST 请求并且它是空的(所以我知道问题不在 sendConfirmation.php,问题是没有 POST 确认文本).我已经在网上搜索过,据我所知,我已经正确设置了.
As you can see I've set the form="confirmationForm" attribute in my textarea tag. I've used Live HTTP Headers to catch the POST request and it is empty (so I know the problem is not in sendConfirmation.php, the problem is that the confirmationText is not being POSTed). I've searched the net and as far as I can see I've set it correctly.
推荐答案尝试将其放入表单标签中,如下...应该可以
try to put it inside the form tag as follows... it should work
<form action="sendConfirmation.php" name="confirmationForm" method="post"> <textarea id="confirmationText" class="text" cols="86" rows ="20" name="confirmationText"></textarea> <input type="submit" value="Email" class="submitButton"> </form>但是您也可以使用相同的方法,但是您需要提供 from id 属性
however you can use the same approach as well but you need to provide the from id attribute then
<form action="sendConfirmation.php" id="confirmationForm" method="post"> <input type="submit" value="Email" class="submitButton"> </form>更多推荐
Textarea 值未随表单一起发布
发布评论