“请填写所需字段” - 隐藏的字段阻止了我的提交
我有一个带有BuddyBoss的WordPress页面。 PageBuilder是Elementor Pro。插件Buddyboss为您提供了Facebook类似功能。在Buddy Boss中,评论帖子& co没问题,但是如果我在Buddyboss系统之外有帖子,我将无法提交评论。为了提交我的评论,必须填写一个隐藏的领域。 代码行
如果我放了一个用ID来定位区域的脚本并尝试删除它不起作用。如果我手动删除它,我可以提交。 你们有什么想法吗?
如果没有隐藏我的文本方面的CSS,它看起来像这样:
<textarea
id="aad669143d1a2b175fb447cb79a28f4b"
aria-label="hp-comment"
aria-hidden="true"
name="comment"
autocomplete="new-password"
style=""
tabindex="-1"
class="error"
aria-describedby="aad669143d1a2b175fb447cb79a28f4b-error"
aria-invalid="true">
</textarea>
I have a wordpress page with buddyboss installed. The Pagebuilder is Elementor pro. The Plugin Buddyboss gives you Facebook like functions. In buddy boss, it's no problem to comment on posts &co, but if I have a post outside of the buddyboss system, I can't submit my comment. There's one hidden field that must be filled in order to submit my comment. Line of code
If I put in a script that targets the area by its Id and tries to delete it, it won't work. If I delete it manually, I can submit it.
Do you guys have any idea?
Without the CSS that hides my Textarea it looks like this:
<textarea
id="aad669143d1a2b175fb447cb79a28f4b"
aria-label="hp-comment"
aria-hidden="true"
name="comment"
autocomplete="new-password"
style=""
tabindex="-1"
class="error"
aria-describedby="aad669143d1a2b175fb447cb79a28f4b-error"
aria-invalid="true">
</textarea>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您在评论中发布的代码,事实证明,针对
aria-label
的目标确实可能是您需要的。为了删除它,您将修改代码如下:第一行基于属性
aria-label
及其值hp-comment
,第二行> Line从HTML树中删除它(应在所有现代浏览器中工作;或者,您可以尝试parentnode
概述的方式)。您可以使用此扩展代码片段尝试一下:
(当然,第2、4和5行只是为了演示而不是真正必要的。)
Based on the code you posted in your comment, it turns out that targeting the
aria-label
might indeed be what you needed. In order to remove it, you would modify your code as follows:The first line finds the element based on the attribute
aria-label
and its valuehp-comment
, the second line removes it from the HTML tree (which should work in all modern browsers; alternatively, you could try theparentNode
way you outlined).You can try it using this extended code snippet:
(Of course, the lines 2, 4 and 5 are just for demonstrating and not really necessary.)