View Full Version : Splitting name and address into two fields
cp_heather
July 7th, 2006, 11:37 AM
Hello,
I received a presentation of the widget applied to my site and the name and email address were shown in two different fields. I followed the API instructions and it puts this information together in one field. How do I do it the other way?
Thanks,
Heather
kas
July 19th, 2006, 12:44 PM
Hi Heather,
We answered this offline for you. For others, check out the function onABCommComplete and do something like:
function onABCommComplete(data)
{
// called when user completes the widget; data is [[name1, email1], [name2, email2], ...]
if (data) {
var nameAndEmail = data[0];
if (nameAndEmail.length > 0) {
setValue('txtNameRecip', nameAndEmail[0]);
setValue('txtEmailRecip', nameAndEmail[1]);
} else alert('no namesAndEmails[0]');
} else alert('no data');
}
yagami-kira
March 20th, 2008, 09:13 PM
OK. My forms for Name and Email address is named friend_name1, friend_email1, friend_name2, etc.
My question is how do I change the below so it will fit to my form?
function onABCommComplete(data)
{
// called when user completes the widget; data is [[name1, email1], [name2, email2], ...]
if (data) {
var nameAndEmail = data[0];
if (nameAndEmail.length > 0) {
setValue('txtNameRecip', nameAndEmail[0]);
setValue('txtEmailRecip', nameAndEmail[1]);
} else alert('no namesAndEmails[0]');
} else alert('no data');
}
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.