douyanpeng0748 2014-10-20 12:48
浏览 89

在表单编辑页面的文本字段中显示双引号

I have number of forms and each form has number of input text fields. The problem that am facing now is,I couldn't show strings with double quotes in text fields.I know we can fix this problem using htmlspecialchars().But I have to do it for each text fields in each form,this will not be a simple task for now.So am seeking a solution,which we can solve it using jquery for all text fields in the project.Please help me to come out from this issue.

All the form data are coming from database.

What am expecting :

Input :test"123"data;
Output in text box :test"123"data;
  • 写回答

1条回答 默认 最新

  • dongliulu1122 2014-10-20 12:51
    关注

    You just need to escape the quotes, like this:

    $('#test').val("\" \"");
    

    More for your example ...

    $('input').each(function(){
        $(this).val("\" \"");
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 如何将下列的“无限压缩存储器”设计出来
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口