1 名家长带着 2 名孩子下拉
我正在尝试使用 JAVASCRIPT 创建 1 个父下拉列表,其中有 2 个从属子下拉列表。
我的 html 页面位于 - http://www.larkgrove.com/entryform/entryform.html< /a>
我正在使用动态选项列表/相关选择: http://www.javascripttoolbox.com/lib/dynamicoptionlist/examples.php
如果您查看我的网站,您会发现我可以让子列表在“无”和“NULL”之间进行更改,但这就是我能做的。
谢谢!
I am trying to create 1 Parent Drop Down, that has 2 dependent child drop down lists using JAVASCRIPT.
My html page is at - http://www.larkgrove.com/entryform/entryform.html
I am using the Dynamic Options Lists / Dependent Selects:
http://www.javascripttoolbox.com/lib/dynamicoptionlist/examples.php
If you check out my site, you can see that I can get the Child lists to change between nothing there and "NULL", but thats about all I can do.
THANKS!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道您正在使用动态选项脚本,但我想我会提出一个从头开始的快速解决方案。 代码有点冗长,但我希望这样可以更容易地了解发生了什么。 最终工作页面在这里:http://ryanscook.com/Files/DropDownListTest.htm
让我们首先假设您有这个 html:
您会注意到我们有一个 onchange 处理程序,这是 java 脚本:
我希望这会有所帮助,并且与您的问题相距不远。
I know you are using the Dynamic options script, but I thought that I would put up a quick from scratch solution. The code is a little verbose, but I am hoping it will be easier to see whats going on this way. The final working page is here: http://ryanscook.com/Files/DropDownListTest.htm
Lets start by assuming you have this html:
You will notice that we have an onchange handler, here is the java script:
I hope this helps and was not to far off from your question.
好吧,首先,让我们看一下您的代码:
我认为这没有达到您的预期目的,尤其是:
看看您如何多次冗余地调用 .forvalue("A") ? 如果您查看代码示例,您会看到:
我会尝试更像这样的事情:
Well, first of all, let's have a look at your code:
I don't think that's doing what you are intending it to do, especially this:
See how you call .forvalue("A") several times redundantly? If you look at the code example you see:
I would try something more like this: