Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用父级、子级和子级下拉框层叠选择_Javascript_Jquery_Django - Fatal编程技术网

Javascript 使用父级、子级和子级下拉框层叠选择

Javascript 使用父级、子级和子级下拉框层叠选择,javascript,jquery,django,Javascript,Jquery,Django,我正在使用django 1.8创建一个表单。在这个表单中,我对三个字段类型、子类型和类别使用级联选择 类型是子类型的父级 子类型是类别的父级 当我更改类型下拉框中的值时,子类型下拉框被禁用,但类别下拉框仍处于活动状态。我想知道如何禁用类别下拉框以及 当用户更改子类型下拉框时,类别下拉框将被禁用 级联选择 CascadeSelect({ use_ajax: true, url: "{{ request.get_full_path }}", // The url for the aj

我正在使用django 1.8创建一个表单。在这个表单中,我对三个字段类型、子类型和类别使用级联选择

类型是子类型的父级

子类型是类别的父级

当我更改类型下拉框中的值时,子类型下拉框被禁用,但类别下拉框仍处于活动状态。我想知道如何禁用类别下拉框以及

当用户更改子类型下拉框时,类别下拉框将被禁用

级联选择

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
});