用于填写表单的单选按钮
嘿。 有没有一种方法,如果用户选择单选按钮,表单的其余部分将自动填写? 大部分表格都是下拉菜单,如果这有区别的话。
谢谢
hey there.
is there a way that if a user selects a radio button the rest of the form will fill out automatically?
most of the form is drop down menu's if that makes a difference.
thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过创建一个为您填写表单字段的函数来完成此操作。然后将该函数设置为单选按钮的 onclick。我整理了一个快速而肮脏的例子来为你做这个。
无法在 Firefox 中工作!刚刚注意到抱歉,我会在一秒钟内弄清楚!
嘿伙计们。抱歉,我忘记了 firefox 不支持innerHtml。您只需将其切换为 .value 即可在两者中使用。
You could do this by making a function that fills out the form fields for you. Then setting that function to the onclick of the radio button. I have put together a quick and dirty example that does just this for you.
Not working in Firefox! Just noticed that sorry, I'll figure it out in a sec!
Hey guys. Sorry I forgot that innerHtml was not supported by firefox. You can simply switch it to .value and it works in both.