我有一個網站,上面有一張信用卡付款表格,我用在其他非常相似的網站上。我遇到的一個問題是,當頁面加載時,信用卡付款選項會自動選中,通常會顯示信用卡的下拉列表。但是,在此站點上,直到在顯示爲已選中的單選按鈕上發生第二次單擊之前,列表纔會顯示。如果有人有任何可能導致這種情況的信息,我會非常感激!如果您將任何內容添加到購物車並查看購物車頁面,則可以在www.seed-city.com
(NSFW)處看到該問題。感謝您的時間。默認的單選按鈕被選中,但下拉不能正確顯示
你可以看到這裏的問題:
http://www.seed-city.com/index.php?option=com_virtuemart &頁= shop.cart & add_id [] = 270 & qadd_270 = 10
我的代碼是:
<div class="yagendoo_vm_checkout_credit_input">
<table>
<tr>
<td nowrap width="10%" align="left"><?php echo $VM_LANG->_('VM_CREDIT_CARD_TYPE'); ?>:</td>
<td>
<script language="Javascript" type="text/javascript"><!--
writeDynaList('class="inputbox" name="creditcard_code" size="1"',
orders, originalPos, originalPos, originalOrder);
//-->
</script>
<?php
$db_cc->reset();
$payment_class = $db_cc->f("payment_class");
$require_cvv_code = "YES";
if(file_exists(CLASSPATH."payment/$payment_class.php") && file_exists(CLASSPATH."payment/$payment_class.cfg.php")):
require_once(CLASSPATH."payment/$payment_class.php");
require_once(CLASSPATH."payment/$payment_class.cfg.php");
$_PAYMENT = new $payment_class();
if(defined($_PAYMENT->payment_code.'_CHECK_CARD_CODE')):?>
<?php $require_cvv_code = strtoupper(constant($_PAYMENT->payment_code.'_CHECK_CARD_CODE'));?>
<?php endif;
endif;?>
</td>
</tr>
<tr valign="top">
<td nowrap width="10%" align="left">
<label for="order_payment_name">
<?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_NAMECARD') ?>:
</label>
</td>
<td>
<input type="text" class="inputbox" id="order_payment_name" name="order_payment_name" value="<?php if(!empty($_SESSION['ccdata']['order_payment_name'])) echo $_SESSION['ccdata']['order_payment_name'] ?>" autocomplete="off" />
</td>
</tr>
<tr valign="top">
<td nowrap width="10%" align="left">
<label for="order_payment_number"><?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PAYINFO_CCNUM') ?>:</label>
</td>
<td>
<input type="text" class="inputbox" id="order_payment_number" name="order_payment_number" value="<?php if(!empty($_SESSION['ccdata']['order_payment_number'])) echo $_SESSION['ccdata']['order_payment_number'] ?>" autocomplete="off" />
更多代碼:
foreach($cards as $code => $name) {
$script .= "orders[".$i++."] = new Array('".addslashes($db_cc->f("payment_method_name"))."','$code','$name');\n";
}
}
$script .= "function changeCreditCardList() { \n";
$script .= "var selected_payment = null;
for (var i=0; i<document.adminForm.payment_method_id.length; i++)
if (document.adminForm.payment_method_id[i].checked)
selected_payment = document.adminForm.payment_method_id[i].id;\n";
$script .="changeDynaList('creditcard_code',orders,selected_payment, originalPos, originalOrder);\n";
$script .="}\n";
$script .="//-->\n";
$script .="</script>\n";
$script .= '<noscript>'.ps_html::selectList('creditcard_code', key($cards), $cards).'</noscript>';
return $script;
}
}
你有任何可以與我們分享的代碼嗎?您是否檢查過調試器,以查看頁面加載過程中是否有錯誤? – 2012-08-13 18:31:03
這看起來像垃圾郵件... – 2012-08-13 18:39:06
請關注該網站的內容並提供SFW代碼示例。 – 2012-08-13 18:40:21