-1
我在這裏使用smarty street插件進行地址驗證。我在窗體上有多個地址字段。我想映射所有的字段。但我想保留一些字段可選。如果我在地址數組中設置了多個地址對象,那麼是否需要爲這兩個字段提供地址?
var liveaddress = $.LiveAddress({
key: htmlKey, // An HTML key from your account
debug: true, // Show debug stuff
waitForStreet: false, // Hides autocomplete suggestions until a street is entered
AutoVerify:true,
addresses:
[{
ID: 'Complainant1',
street: '#complainantOneStreetAddress',
city: '#complainantOneCity',
state: '#complainantOneState',
zipcode: '#complainantOneZip'
}
,
{
ID: 'Complainant2',
street: '#complainantTwoStreetAddress',
city: '#complainantTwoCity',
state: '#complainantTwoState',
zipcode: '#complainantTwoZip'
},
{
ID: 'Suspect',
street: '#suspectStreetAddress',
city: '#suspectCity',
state: '#suspectState',
zipcode: '#suspectZip'
},
{
ID: 'Vehicle',
street: '#vehicleOwnerAdddress',
city: '#vehicleOwnerCity',
state: '#vehicleOwnerState',
zipcode: '#vehicleOwnerZip'
},
{
ID: 'BusinessInfo',
street: '#businessStreetAddress',
city: '#businessCity',
state: '#businessState',
zipcode: '#businessZip'
}
]
});
問題是我想保留ID:'申訴1'需要,但其他應該是可選的。 現在它給我提交錯誤。數組中的其他ID是空的。可能嗎?你能否建議我一種不同的方法?
我的回答有用嗎? – camiblanch