Javascript隐藏文本框 [英] Javascript to hide a text box

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

问题描述




你能帮我写一个javascript代码来实现一个隐藏在下拉框旁边的文本框。只有当我们开启文本框时才能启用从下拉框中选择一个其他选项。请帮助我,紧急。


先谢谢你........



would you please help me in writing a javascript code to implement a text box that is hidden beside a drop down box.the text box should be enabled only when we select an "others"option from a drop down box.please help me,its urgent.

Thank you in Advance........

推荐答案

欢迎来到TSDN。


应隐藏还是禁用?


你会的需要在选择中使用onchange事件:

[HTML]< select ... onchange =" ..."> [/ HTML]调用将启用/显示的函数文本框。假设txtobj是文本框对象而selObj是选择对象:
Welcome to TSDN.

Should it be hidden or disabled?

You''ll need to use the onchange event on the select:
[HTML]<select ... onchange="...">[/HTML] Call a function that will enable/show the text box. Assuming txtobj is the text box object and selObj is the select object:
展开 | 选择 | Wrap | 行号


感谢你的回复。


当我们在给定的组合框中选择规范时以及当我们选择其他时,应该隐藏文本框。在该规范文本框中应该可以写入
Thank-U for your reply.

The text box should be hidden when we select specifications in given combo box and when we select "others" in that specifications text box should be visible to write into it


发布你目前为止的代码/ HTML。


试试并按照我的第一篇文章替换
Post your code/HTML that you''ve got so far.

Try and follow my first post replacing
展开 | 选择 | Wrap | 行号


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

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