报价标记已突破值容器

发布于 2025-02-11 18:40:28 字数 369 浏览 0 评论 0原文

我将SQL从SQL调用HTML代码为Textarea的“值”或 例如

<Input type=text value="<p>this is a website <a href="https://example.com>Click Here</a></p>"></input>

,现在的问题是“ HREF中的关闭值并未在文本框中显示完整数据。

文本方面也发生了同样的情况。

是否有其他方法可以将此HTML转换为可编辑的表单而不破坏网站。

我试图通过AJAX在SQL中更新SQL中的HTML代码,但我无法将代码从SQL检索到任何可编辑的文本输入中。

I am calling the html code from the SQL into a the "value" of Textarea or
For instance

<Input type=text value="<p>this is a website <a href="https://example.com>Click Here</a></p>"></input>

Now The problem is that The " in the href is closing the value and complete data is not displayed in the textbox.

Same is happening with the textarea.

Is there any other method to convert this html into editable form without breaking the website.

I am trying to update the html code in the SQL via a form through ajax. The update is working fine but i am unable to retrieve the code from the SQL into the any editable text input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴骨ら 2025-02-18 18:40:28

使用单个引号,而不是外部value字段的双引号:

<Input type=text value='<p>this is a website <a href="https://example.com>Click Here</a></p>'></input>

您还可以尝试使用将逃脱双引号的JSON编码。

Use single quotes, instead of double quotes for the outer value field:

<Input type=text value='<p>this is a website <a href="https://example.com>Click Here</a></p>'></input>

You can also try using JSON encode which will escape the double quotes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文