隐藏文本框直到用户需要它们 [英] Hide Text boxes until users needs them

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

问题描述

您好,


我正在尝试使用我的表单中的一部分,允许用户点击此处添加其他帐号。如果他们点击此处,则会显示另一个文本框。但是,如果他们不点击这里,他们将永远不会看到这些额外的文本框。有谁知道这需要什么样的脚本?感谢您的帮助。

解决方案

您好朋友,您不需要做太多的事情。您想要的文本框是可选的,您需要添加一些东西。


[HTML]< input type =" text" ID = QUOT; myOptionalTextBox"名称= QUOT; myOptionalTextBox"风格= QUOT; dispaly:无;"值= QUOT;" /> [/ HTML]如果你要写style =" dispaly:none;"它不会在页面上默认显示文本框


现在第二件事就是在按钮的onclick上调用这个函数,

就像

[HTML]< input type =" button" Id =" showTextBox" onclick =" showButton();" /> [/ HTML]

现在写在脚本标签里面调用这个函数

展开 | 选择 | Wrap | 行号


请注意拼写:显示应该是显示。


感谢您的指导。我还是有点困惑。我在下面有一个小的表单代码。你能告诉我如何将它输入到我的代码中以使其工作吗?


正是我想要做的是允许用户点击点击此处。链接允许两个文本框像最初一样显示,以便用户可以输入其他信息。


此外,用户可能有4个不同的帐户要输入。是否有可能继续允许他们点击这里。获得更多文本框以显示或者更容易让他们点击此处一次然后说6个文本框出现。


非常感谢你的帮助

展开 | 选择 | Wrap | 行号

Hello,

I am trying to have a section of my form that allows users to "click here" to add additional account numbers. If they "click here", then an additional text box will appear. But, if they don''t "click here", they will never see these additional text boxes. Anyone know what kind of script is necessary for this? Thanks for any help.

解决方案

Hi friend you need not to do so many things.The text box you want as optional you need to add few things.

[HTML]<input type="text" Id="myOptionalTextBox" name="myOptionalTextBox" style="dispaly:none;" value="" />[/HTML]If you will write style="dispaly:none;" it will not display the textbox by default on the page

Now second thing call this function on the onclick of the button,
like
[HTML]<input type="button" Id ="showTextBox" onclick="showButton();"/>[/HTML]
now write inside the script tag call this function

Expand|Select|Wrap|Line Numbers


Be careful with the spelling though: "dispaly" should be "display".


thank you for your guidance. I am still a bit confused. I have a small form code below that I am using. Could you show me how to input this into my code to make it work?

Exactly what I am trying to do is allow the user to click the "Click here" link to allow two text boxes to appear just as they do originally so the user can enter additional information.

Also, the user might have 4 different accounts to enter. Would it be possible to keep allowing them to "click here" to get more text boxes to show OR would it be easier for them to "click here" once and then say 6 text boxes show up.

Thank you so much for your help

Expand|Select|Wrap|Line Numbers


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

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