我有 3 个选择框,它们根据每个框中的选择动态加载。在我尝试使用 jqtransform 插件设置页面样式之前,这些可以正常工作。我试图弄清楚这一点,并搜索了这个网站和网络,但没有找到解决方案,如果我使用 jqtransform 插件,为什么选择菜单根本不填充。任何帮助将不胜感激。
原始工作代码:
`<script language="JavaScript" src="myminiAJAX.js"></script>
<script language="JavaScript" src="functions.js"></script>
<script language="JavaScript">
function init() {
doAjax('man_list.php', '', 'populateComp', 'post', '1');
}
function showOutput(){
alert("This Is Your Model Id: "+getValue('manufacturer'));
}
$(function(){
$('form').jqTransform({imgPath:'jqtransformplugin/img/'});
});
</script>
<style>
#loading{
background:url('loader64.gif') no-repeat;
height: 63px;
}
</style>
</head>
<body onLoad="init();">
<p>
<form method="post" action="<?php echo $PHP_SELF;?>">
<b>System Type:</b> <select name="manufacturer" id="manufacturer" onChange="resetValues();doAjax('type_list.php', 'man='+getValue('manufacturer'), 'populateType', 'post', '1')">
<option value="">Please select:</option></select>
<br /><b>Type of Equipment: </b> <select name="printertype" id="printertype" disabled="disabled" onChange="doAjax('model_list.php', 'man='+getValue('manufacturer')+'&typ='+getValue('printertype'), 'populateModel', 'post', '1')">
<option value="">Please select:</option></select>
<br /><b>Equipment to be depoted out:</b> <select name="printermodel" id="printermodel" disabled="disabled" onChange="showOutput();">
<option value="">Please select:</option></select>
<br /><br /><input type="submit" name="action" value="Submit" />
添加Jqtransform插件后的代码:
<link rel="stylesheet" href="jqtransformplugin/jqtransform.css" type="text/css" media="all" />
<link rel="stylesheet" href="demo.css" type="text/css" media="all" />
<script language="JavaScript" src="myminiAJAX.js"></script>
<script language="JavaScript" src="functions.js"></script>
<script type="text/javascript" src="requiered/jquery.js" ></script>
<script type="text/javascript" src="jqtransformplugin/jquery.jqtransform.js" > </script>
删除了缩短这篇文章的函数,因为它们没有改变原始代码。
<body onLoad="init();">
<p>
<form method="post" action="<?php echo $PHP_SELF;?>">
<div class="rowElem"><b>System Type:</b> <select name="manufacturer" id="manufacturer" onChange="resetValues();doAjax('type_list.php', 'man='+getValue('manufacturer'), 'populateType', 'post', '1')">
<option value="">Please select:</option></select>
</div>
<div class="rowElem"><br /><b>Type of Equipment: </b> <select name="printertype" id="printertype" disabled="disabled" onChange="doAjax('model_list.php', 'man='+getValue('manufacturer')+'&typ='+getValue('printertype'), 'populateModel', 'post', '1')">
<option value="">Please select:</option></select>
</div>
<div class="rowElem"><br /><b>Equipment to be depoted out:</b> <select name="printermodel" id="printermodel" disabled="disabled" onChange="showOutput();">
<option value="">Please select:</option></select>
</div>
<div class="rowElem"><br /><br /><input type="submit" name="action" value="Submit" /> </div>
</p>
<div id="loading" style="display: none;"></div>
<div id="output"></div>