输入类型文本显示为不同,值为不同 [英] input type text display as different and value as different

查看:85
本文介绍了输入类型文本显示为不同,值为不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在表单中使用输入类型文本..并使用自动完成..当我按妈妈时,我得到列表



孟买(Bom)

Mumbra(妈妈)





现在从上面,我选择Mumbra(妈妈)

显示的输入文字,Mumbra(妈妈),当我点击搜索时,

它会以形式动作传递给Mumbra(妈妈),但是我想通过输入文本的值传递Mumbra,但在文本中显示为Mumbra(妈妈)



如何做到这一点

Hi
I use input type text in form..and use autocomplete..when i press mum , i get list with

Mumbai(Bom)
Mumbra (Mum)


now from above, i select Mumbra (Mum)
in input text it shows, Mumbra (Mum), and when i click search,
it passes in form action as Mumbra (Mum) , but i want to pass Mumbra in value of input text but display in text as Mumbra (Mum)

how to do this

推荐答案

使用 <$的方法之一c $ c>字符串类 [ ^ ]将文本拆分为您想要的部分。然后,您可以只传递搜索所需的部分,同时将原始部分保留在文本或组合框中。
Use one of the methods of the String class[^] to split the text into the parts you want. You can then pass just the part that you need for the search, while leaving the original in your text or combo box.


这篇关于输入类型文本显示为不同,值为不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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