需要你的帮助变化选择框自动完成的jQuery的PHP回声
我想改变选择框,自动完成的jQuery 我在这里的工作选择框
<select name="sShippingPayment" title="simple;<?php echo $lang['Select_shipping_and_payment']; ?>" onchange="countShippingPrice(this)" id="oShippingPayment">
<option value=""><?php echo $lang['Select']; ?></option>
<?php echo $sShippingPaymentSelect; ?>
</select>
,并在这里我jQuery的
<form action='' method='post'>
<p><label>Shipping & Payment:</label><input type='text' name='sShippingPayment' value='' class='auto'></p>
</form>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {
//autocomplete
$(".auto").autocomplete({
source: <?php echo $sShippingPaymentSelect; ?>,
minLength: 1
});
});
代码
但它不会工作,请帮助我。
我检查PHP文件
* Returns shipping and payment select
* @return string
*/
public function throwShippingPaymentsSelect(){
$aShipping = $this->throwPaymentsShipping(2);
$aPayments = $this->throwPaymentsShipping(1);
if(isset($aShipping) && isset($aPayments)){
$content = null;
foreach($aShipping as $iShipping => $aData){
if(isset($aData['aPayments'])){
foreach($aData['aPayments'] as $iPayment => $sPriceModify){
if(isset($aPayments[$iPayment])){
$fShippingPaymentPrice = !empty($sPriceModify) ? generatePrice($aData['fPrice'], $sPriceModify) : $aData['fPrice'];
$content .=
'<option value="'.$iShipping.';'.$iPayment.';'.$fShippingPaymentPrice.'">'.
$aData['sName'].' : Rp. '.
displayPrice($fShippingPaymentPrice)
.'</option>';
}
} // end foreach
}
} // end foreach
return $content;
}
} // end function throwShippingPaymentsSelect
我应该不需要更改
$content .=
'<option value="'.$iShipping.';'.$iPayment.';'.$fShippingPaymentPrice.'">'.
$aData['sName'].' : Rp. '.
displayPrice($fShippingPaymentPrice)
.'</option>';
被理解为自动完成源?请帮助如何改变这一点。
真的非常感谢您的回答。
“不起作用”是什么意思?它现在在做什么? – dudewad 2014-08-27 21:00:45