Javascript 使用父级、子级和子级下拉框层叠选择
我正在使用django 1.8创建一个表单。在这个表单中,我对三个字段类型、子类型和类别使用级联选择 类型是子类型的父级 子类型是类别的父级 当我更改类型下拉框中的值时,子类型下拉框被禁用,但类别下拉框仍处于活动状态。我想知道如何禁用类别下拉框以及 当用户更改子类型下拉框时,类别下拉框将被禁用 级联选择Javascript 使用父级、子级和子级下拉框层叠选择,javascript,jquery,django,Javascript,Jquery,Django,我正在使用django 1.8创建一个表单。在这个表单中,我对三个字段类型、子类型和类别使用级联选择 类型是子类型的父级 子类型是类别的父级 当我更改类型下拉框中的值时,子类型下拉框被禁用,但类别下拉框仍处于活动状态。我想知道如何禁用类别下拉框以及 当用户更改子类型下拉框时,类别下拉框将被禁用 级联选择 CascadeSelect({ use_ajax: true, url: "{{ request.get_full_path }}", // The url for the aj
CascadeSelect({
use_ajax: true,
url: "{{ request.get_full_path }}", // The url for the ajax function
parent: "id_project_type", // Name of the parent field in forms.py
child: "id_sub_type", // Name of the child field in forms.py
selected_child: "{{ selected_sub_type }}", // Sent from views.py
empty_label_init: "Select a type first",
empty_label_selected: "--- Please select ---",
disable_child: true
});
CascadeSelect({
use_ajax: true,
url: "{{ request.get_full_path }}", // The url for the ajax function
parent: "id_sub_type", // Name of the parent field in forms.py
child: "id_category", // Name of the child field in forms.py
selected_child: "{{ selected_sub_type }}", // Sent from views.py
empty_label_init: "Select a type first",
empty_label_selected: "--- Please select ---",
disable_child: true
});