jsp如何实现选择部门了再去选择部门下的人员呢

jsp怎么实现选择部门了再去选择部门下的人员呢
如图我选择了二部但是还是只有一部的人,对ajax不太熟
jsp如何实现选择部门了再去选择部门下的人员呢
这是获取下拉框的内容的代码两个tree。nmanagerid是人,ndeptid是部门
$('#nmanagerid').combobox({
url : '${ctx}/sys/user/tree?usertype=5&orgid=${deptid}',
 valueField: 'id',
                         textField: 'text',
                         editable: false,
                         panelHeight: 'auto',
 lines : true  
});
$('#ndeptid').combobox({
url : '${ctx}/sys/org/tree?ifbusinessdept=1',
 valueField: 'id',
                         textField: 'text',
                         editable: false,
                         panelHeight: 'auto',
 lines : true  
});

请问要怎么写触发器去判断呢?
------解决思路----------------------
$('#ndeptid').change(function(){修改deptid值};);
------解决思路----------------------
$('#ndeptid').change(function(){修改deptid值}); 手误多了个分号
------解决思路----------------------
这个就应该是一个联动效果。数据库设计好了用Ajax请求去取值就行了
------解决思路----------------------
$("#xx").combobox({
onChange: function (n,o) {
alert("xxxxxxx");
}
});