编码文本框 [英] coding text boxes

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

问题描述

有没有办法对此进行编码
http://i51.tinypic.com/efqsgi.gif [ http://jsbin.com/uduzo [ ^ ]

is there a way to code this
http://i51.tinypic.com/efqsgi.gif[^]

if you didn''t get what is happening in the picture:
when you click on a text box it expands and also has a select menu to the right

here is an example i found:
http://jsbin.com/uduzo[^]

推荐答案

是的,让我告诉你如何做.但是您必须尝试自己编写代码.

i)在您的网页上添加一个文本框.现在,添加一个填充有所需值的下拉列表,并使该列表不可见.
注意:重要的是使用样式display: none;使其不可见,而不是将控件的可见性设置为false.
ii)然后在文本框的onclick上附加一个JavaScript函数.
此函数将执行以下操作:
a)将文本框的可见性设置为false. (再次,使用样式显示:无)
b)将下拉菜单的可见性设置为true.

您还需要注意两个控件的样式,以便它们完全位于图片中所示的相同位置.

这不是很难.试一试.如果遇到问题,请尽快回来.
Yes there is and let me tell you how. But you have to try and code it yourself.

i) On your web page add a text box. Now add a drop down list populated with required values and make it invisible.
Note: It is important to use the style display: none; for making it invisible rather than setting the visibility of the control to false.
ii) Then attach a JavaScript function on onclick of the text box.
This function will do following things:
a) Set the visibility of the text box to false. (Again, using the style display: none)
b) Set the visibility of the drop down to true.

You also need to take care of the styles of both the controls so that they lie exactly at the same place as shown in the picture.

It is not very hard. Give it a try. Get back in case you have issues.


这篇关于编码文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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