如何使用单引号显示运行时值的文本框 [英] how to display textbox with single quote for runtime value

查看:94
本文介绍了如何使用单引号显示运行时值的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在运行时在javascript中创建了一些文本框,我在运行时检索数据库中的值到文本框,如果值在单词之间有单引号,它在单引号文本后跳过,例如,如果文本是HI'TEXT ..它只显示HI。但它正确地保存在数据库中作为HI'TEXT。如何解决这个

Hi,

I have created some of the textboxes at runtime in the javascript, i retrieve the values from the database to the textbox at runtime, if the value has single quote in between the words, it skips after the single quote text, for example if the text is HI'TEXT.. It displays only HI. but it saved in the database correctly as HI'TEXT. How to resolve this

推荐答案

用& lsquo替换';
replace " ' " with ‘


我们可以使用.Replace(' ,');



请注意&和#之间没有空格,需要张贴空格,因为输出再次显示为'
We can use .Replace("'","& #39;");

Please note no space in between & and #, need to post with space as output is showing as "'" again


这篇关于如何使用单引号显示运行时值的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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