繁体   English   中英

如何使Choicefield不可见?

[英]how to make a Choicefield invisible?

我有两个ChoiceField :第一个有两个值,第二个应该不可见。

我希望能够在单击第一个值时显示第二个值。

有什么建议吗?

@Joran是正确的。 您将需要使用JavaScript onChange事件处理程序来显示/隐藏第二个选择选项。 jQuery使这个琐碎:

var first_select = $('#id_first_select'),
    second_select = $('#id_second_select');

first_select.change(function() {
    // Not checking for a particular value needed, etc.
    second_select.show();
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM