Textarea 值未随表单一起发布

编程入门 行业动态 更新时间:2024-10-26 22:23:15
本文介绍了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,问题是没有 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 值未随表单一起发布

本文发布于:2023-10-09 18:01:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1476392.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   Textarea   值未随

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!