var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
function getContactPhone(username, objID) {
var obj = document.getElementById(objID);
xmlhttp.open("GET", "/names.nsf/GetOfficePhone?OpenAgent&username=" + username);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.value = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
So I have the onBlur event for the contact field set to getContactPhone(document.forms[0].contact.value,'contact_phone'); so that the contact's phone number is looked up in the Public Address Book whenever the user tabs out of the field. The agent I created, GetOfficePhone, returns the user's phone number I want with 2 print statements:
Print "Content-type: text/plain"
Print doc.OfficePhoneNumber(0)
This technique could definitely be expanded to do full blown @DbColumn and @DBLookup functions.
Created 6/29/2005 9:25:13 AM email | website
After slapping myself over stupid ACL mistakes on my test, I got it to work like a charm in IE. No go in Firefox or Netscape though until I set the "ID" in the HTML properties tab of the phone field. Will blog on this later.
Created 6/30/2005 2:41:46 AM email | website
Nice work. A complete implementation of a Javascript DBLookup and a DBColumn function can be found here { Link }
Created 6/30/2005 11:04:10 AM email | website
Matt has posted a link to a tip i had posted on Search Domino.
That eventually was selected as Tip of the Month and i won an iPod Mini.
cheers !!
Ashish
Created 4/20/2008 12:43:05 PM email | website
Good work. Easy and convenient.
Created 5/11/2010 6:48:04 AM email | website
Hi;
Unfortunately, although I realize I could not read the topic defalrca to help me in this regard would be glad if the mail.
mary lou
marylou23@gmail.com
{ Link }
Created 7/29/2010 6:12:34 AM email | website
Yaz sezonun gelmesiyle beraber bilinir ki oto kiralama'da büyük bir yoğunluk soz konusu olmuştur. Ankara'da oto kiralama hizmeti veren bir firma olan alper oto kiralama ankarada en iyi oto kiralama hizmeti veren firmalaradan biri olarak müşterilerini bu sezonda'da yanlız birakmayarak gerekli tedbirleri almış ve araç filosunu genişletmiştir.