好的,我在select字段上有一个onchange事件。它现在很棒。当下拉“网络”更改时,它会刷新第二个下拉列表。我还希望顶部的ajax代码在页面加载和onchange上触发,以便填充第二个列表。这是因为它在编辑页面上。这是使用第一个的ajax调用
function get_cities(networks) {
$.ajax({
type: "POST",
url: "select.php", /* The country id will be sent to this file */
beforeSend: function () {
$("#folder").html("Loading ...");
},
//data: "idnetworks="+networks,
data: "idnetworks="+networks +"&doc="+ <?php echo $row_rs_doc['parentid']; ?>,
success: function(msg){
$("#folder").html(msg);
}
});
}
现在是两个下拉框
do {
?>
><?php echo $row_rs_net['netname']?>
} while ($row_rs_net = mysql_fetch_assoc($rs_net));
$rows = mysql_num_rows($rs_net);
if($rows > 0) {
mysql_data_seek($rs_net, 0);
$row_rs_net = mysql_fetch_assoc($rs_net);
};
?>