AJAX and Directory Entries (Sensing)

This is a web application. I have a customer field (first + last name) that needs to be a bit more intelligent. We had a directory buitton next to the field that grabbed entries from names.nsf. Is there a way (AJAX?) to have the field “sense” what is being entered and display a list of matches? e.g. I type “Ra” and a box (attached to bottom of field) displays the following:

Rankin, Tom

Raster, Will

Raston, Hank

…

I have seen similar on sites… but this would need to query the directory (or directories if DA is used) vs. just remembering what has been entered in the field.

Subject: AJAX and Directory Entries (Sensing)

Try this:

http://www.codestore.net/store.nsf/unid/BLOG-20060307?OpenDocument

I use it all over the place (I’ve even “borrowed” Jake’s close dialog X graphic because I like the style). There are a couple of other “Rough Cut” documents on Jake’s site dealing with this as well, which may provide more information.

Subject: RE: AJAX and Directory Entries (Sensing)

Try this one from OpenNTF.org;

http://www.openntf.org/Projects/codebin/codebin.nsf/0/0D95F1B6946D706D8625705F0049AB59

What you are describing is exactly what is coded within this dB.

Thanks,

Ken

Subject: RE: AJAX and Directory Entries (Sensing)

Thanks Ken… great suggestion. Missed that one in OpenNTF.

Subject: RE: AJAX and Directory Entries (Sensing)

Thanks Joel! Will check into it…

Subject: RE: AJAX and Directory Entries (Sensing)

I tried the AJAX name picker… great stuff. My name shows up in the “EmployeeName” field but does not trigger the onChange. When the name is selected and present in the EmployeeName field, it should do the query against the directory and populate several fields like address, phone, email, etc… My formulas work if not using the AJAX picker… am assuming it is how the field is populated via AJAX. I just want to kick-off a funtion (in my JSHeader) when the script finishes putting the name in the EmployeeName field. Could I add to the namepicker.js library? …or somewhere else?

Subject: RE: AJAX and Directory Entries (Sensing)

You should be able to simply call your function in the “callback” function in the namepicker library. I’ll have to look it over again as I don’t remember what this function is called, but it’s the one that handles the ajax return. (UPDATE: The function is list_results). You should be able to simply add a call here to your function that populates the fields. If your code is simple enough, you could just move it to the callback function. For anything more complex, it’s probably better to keep it separated for readability. Ditto if you might need to call your function from somewhere else.