以下是示例代码:
function fill_product(i){
var form1 = document.getElementById("form1");
form1.product.options.length=0;
switch(i)
{
case 0:
form1.product.options[0] =new Option('**get data from database, like the select query**');
form1.product.options[1] =new Option('**get data from database, like the select query**');
break;
case 1:
form1.product.options[0] =new Option('**get data from database, like the select query**','');
form1.product.options[1] =new Option('**get data from database, like the select query**');
form1.product.options[2] =new Option('**get data from database, like the select quer**y');
break;
在上面的代码中 - 如何查询和选择数据库中的数据?