Textarea值未与表单一起发布 [英] Textarea value not getting posted with form

查看:89
本文介绍了Textarea值未与表单一起发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提交表格时,我试图输入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中,问题是确认文本没有被发布).我已经搜索了网,并据我所知正确地设置了它.

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值未与表单一起发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆