0
我真的陷入了困境,試圖找出如何預先選擇一個選項添加使用addfield下拉。 我添加這樣的文本字段,我可以填充使用:value:'xyz'在字段的數組中。但選擇框不能識別。 任何人都可以請幫忙。 (也,我使用Idealforms 2,不是3) 我的下拉代碼如下所示:Idealforms:預選選項與加號字段
var newFields = [
{
name: 'accounttype',
label: 'Account type',
filters: 'exclude',
data: { exclude: ['default'] },
errors: { exclude: 'Please select account type' },
type: 'select',
list: [
'Select account type::default',
'Current/Cheque::1',
'Savings::2',
'Transmission::3'
],
value: 'Transmission::3',
addAfter: 'pay-options'
},
我試過在價值線的所有可能的選項,也試過以後選擇它使用jQuery下面的情況下,其AJAX時間問題。但仍然很困難。請可能有人來看看:)
var my_accounttype = '3';
$('#accounttype option').each(function(){
var $this = $(this);
if ($this.val() == my_accounttype) {
alert ($this.val() + " == " + my_accounttype);
$this.prop('selected', true);
return false;
}
});
人有什麼想法? V