108 ◾ PhoneGap Build
var contacttofind = "";
var contactslist = document.getElementById("contactslist").
getElementsByTagName("INPUT");
for (var i = 0;i<contactslist.length;i++) {
if (contactslist[i].type.toUpperCase() = ='RADIO') {
if(contactslist[i].checked)
contacttofind = contactslist[i].value;
}
}
if(contacttofind.trim().length >0) {
var options = new ContactFindOptions();
options.filter = contacttofind;
var fields = ["displayName", "name", "organizations", "addresses",
"emails", "phoneNumbers"];
if (task = = 'delete')
navigator.contacts.find(fields, deleteContact, findError, options);
else
navigator.contacts.find(fields, showContactInfo, findError,
options);
}
else
document.getElementById("response").innerHTML = "No contact selected" ...