Thank you etully... thats what I had done more or less. And to MarkR, Yes I understand how all these pages work, the only thing I was asking that you answered for sure was:
"A PHP script which returns data as an AJAX POST (e.g. using XMLHttpRequest) cannot place further Javascript code in the response"
Here, for anybody who cares, is what I ended up doing...
setup: this is for a mySQL CMS system, specifically a page for adding a new row... and getting a scriptaculous dropdown of values entered already in the database in a autocompleter when typing in the new field. CONFUSED YET?
So the ADD page is loaded with AJAX and has an ongetfocus event in each textfield, which calls a JS function already loaded on initial page load (like etully mentioned) which uses function variables to custom make the JS for the dropdowns. Another ajax page gets the field value on change and queries teh DB for matches and returns them in a drop down below the field for selecting. VOILA!
Sorry if this is rushed, but I figured it out at 5am and just wanted to let people know how I did it...
Thanks for the help!
Ben