Jquery Idealforms:使用addfield预选选项
我真的很想知道如何在使用addfield添加的下拉列表中预选一个选项。 我这样添加的文本字段可以在字段数组中使用:value:'xyz'填充。但是选择框没有识别出这一点。 谁能帮忙吗。 (另外,我使用的是Idealforms 2,而不是3) 我的下拉列表代码如下所示:Jquery Idealforms:使用addfield预选选项,jquery,idealforms,Jquery,Idealforms,我真的很想知道如何在使用addfield添加的下拉列表中预选一个选项。 我这样添加的文本字段可以在字段数组中使用:value:'xyz'填充。但是选择框没有识别出这一点。 谁能帮忙吗。 (另外,我使用的是Idealforms 2,而不是3) 我的下拉列表代码如下所示: var newFields = [ { name: 'accounttype', label: 'Account type', filters: 'exclude', data: { exc
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计时问题。但还是很困。请有人看一下:)
有人有什么想法吗?
V算出了!
这是一项任务,但接下来。。。
您所要做的就是在从html select输入转换到idealforms样式的列表后找到实际的元素。然后模拟点击
( document ).ready(function() {
dateforuse = gup('salarydate3');
if(dateforuse[0] == 0){ dateforuse = dateforuse[1]; } //in case date below 10 and leads with a zero
$( ".salarydate3 li ul li" ).each(function( index ) {
if( $( this ).text() == dateforuse){
$( this ).click();
}
});
});
( document ).ready(function() {
dateforuse = gup('salarydate3');
if(dateforuse[0] == 0){ dateforuse = dateforuse[1]; } //in case date below 10 and leads with a zero
$( ".salarydate3 li ul li" ).each(function( index ) {
if( $( this ).text() == dateforuse){
$( this ).click();
}
});
});