同时具有->的文本框文字+价值 [英] textbox having both -> text + value

查看:72
本文介绍了同时具有->的文本框文字+价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


是否有一个看起来像文本框的控件,但是您可以为它保存文本和值-表示为两个differnetnet值.文本将可见,但价值将不高.
我知道可以对下拉列表执行此操作,但我需要使其看起来像文本框.谢谢您.

Hi,
is there a control which looks like textbox but you could save for it text and value - meant as two differenet values. Text would be visible but value wouldn''t.
I know that it''s possible to do it for drop down lists but I need it to look like textbox. Thank you

推荐答案

我尝试输入type ="text",并使用ID作为ID,使用Value作为文本,使用Name作为Value.但是当我在Javascipt中访问它时,Name与ID完全相同(我使用了两个不同的值)
I have tried input type="text" and use ID as ID, Value as Text and Name as Value. But when I accessed it in Javascipt, Name was completely the same as ID (I used two different values)


您可以使用您所描述的内容. HTML文本框具有2个感兴趣的属性-名称/标识和值.没有真正的理由为名称和ID使用不同的值.将"your value"作为文本框的名称或ID,并将"your text"作为"value",如下所示:
You can use what you have described. The HTML text box has 2 properties of interest - name/id and value. There is no real reason to use different values for name and id. Put ''your value'' as the name OR ID of the text box and ''your text'' as the ''value'' as below:
<input type="text" name="<your value>" value="<your text>" />


这篇关于同时具有-&gt;的文本框文字+价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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