使用占位符将值插入文本框 [英] Using a placeholder to insert a value in to a textbox

查看:152
本文介绍了使用占位符将值插入文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个格式化的字符串,其中包含项目的描述(我使用的是扩展的RFT编辑器,然后转换为HTML)。我想然后将该描述插入到包含HTML的另一个字段中。我想象在HTML中使用某种占位符,但我对另一种解决方案感到满意。



例如在伪html中:

I have a formatted string that contains a description of an item (I'm using an extended RFT Editor then converting to HTML). I want to then insert that description into another field that contains HTML. I imagined using a placeholder of some sort in the HTML, but I'd be happy with another solution.

For example in pseudo html:

<PAGE HTML>
<DIV>
{DESCRIPTION}
</DIV>
<MORE PAGE HTML>





将转换RTF格式的字符串o HTML,但是如果我改变HTML,插入的位置可能会改变,所以使用索引等可能会出来。



结果将是所有人共有的HTML模板带有占位符的记录,然后用于构建显示,并在我上传到我的网站时为每条记录的适当位置嵌入特定描述。



任何想法这该怎么做?我考虑做直接查找替换,但想知道是否有更好的方法?



The RTF formatted string will be converted to HTML, but the location of the insertion may change if I alter the HTML so using indexes etc is probably out.

The result will be a HTML template common to all records with placeholders, which is then used to build the display with the specific description embedded in the proper place for each record whe I upload to my website.

Any ideas on how to do this? I considered doing a straight find replace but wanted to know if there's a better way?

推荐答案

这篇关于使用占位符将值插入文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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