0
收到我有這樣的Java腳本:jqtransform不變換值從阿賈克斯
$("#judet div.jqTransformSelectWrapper ul li a").click(function(){
var jud= $("#judetul1").val();
$.ajax({
type: "POST",
url: "rental/cms/inc/ajax/cities.php",
data: { 'jud': jud },
success: function (msg) {
$("#oras1").html(msg);
},
error: function (xhr, err) {
alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
alert("responseText: " + xhr.responseText);
}
});
});
和這個網站:
<div class=" h">
<span class="block">Orasul</span>
<div class="select6" id="oras">
<select name="oras1" id="oras1" onchange="zone1();sectorul();">
</select>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
這個PHP:
public function get_oras($code3) {
echo "<option selected='selected' value='0'>Alege oras</option>";
$code='PPLA';
$code2='PPLA2';
$sql="SELECT * FROM `locatii` WHERE (`feature_code`=:code OR `feature_code`=:code2) AND `admin1_code`=:code3 ORDER BY `asciiname` ASC";
$stmt = $this->dbh->prepare($sql);
$stmt->bindParam(':code', $code, PDO::PARAM_STR, 30);
$stmt->bindParam(':code2', $code2, PDO::PARAM_STR, 30);
$stmt->bindParam(':code3', $code3, PDO::PARAM_INT);
$stmt->execute();
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $result)
{
$oras[]="<option value='".$result['geonameid']."'>".$result['asciiname']."</option>";
}
return $oras;
}
的HTML judetul:
<div class=" h">
<span class="block">Judetul</span>
<div class="select6" id="judet">
<?php $judetul=$db->get_judet(); ?>
<select name="judetul1" id="judetul1" >
<option selected="selected">---</option>
<?php foreach ($judetul as $val=>$k) { ?>
<option value="<?php echo $val; ?>"><?php echo $k; ?></option>
<?php } ?>
</select>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
問題是:
沒有jqtransform腳本工作很好,但如果我包括jqtransform選擇oras1未填充。 我認爲這是一個問題,因爲我首先轉換一個表單,然後用值填充...以便值不會轉換爲我的oras1選擇。
我該如何解決? 我可以在將值填充到值之後轉換該值嗎? 非常感謝!