Rob,<br>
<div><div><br>
&nbsp;I was recently working on a similar problem.<br>
&nbsp;You will need to use the xmlhttprequest function in Javascript do
all the work. And its quite easy once you get the hang of it. Heres a
good tutorial to get started:<br>
<a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html">http://developer.apple.com/internet/webcontent/xmlhttpreq.html</a><br>
<br>
For your problem, if your required server result is a simple list, let
a zope script generate a tab-delimited list and you can retrive it
using the request.responseText (see the xmlhttprequest) and skip
working with the XMLDOM, which can by quite annoying.<br>
<br>
Rushabh<br>
<br>
----------------------------<br>
Message: 8<br>
Date: Wed, 29 Jun 2005 12:20:17 -0700 (PDT)<br>
From: Rob Boyd &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:boydrobh@yahoo.com">boydrobh@yahoo.com</a>&gt;<br>
Subject: [Zope] TAL and Javascript<br>
To: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:zope@zope.org">zope@zope.org</a><br>
Message-ID: &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:20050629192017.66907.qmail@web42005.mail.yahoo.com">20050629192017.66907.qmail@web42005.mail.yahoo.com</a>&gt;<br>
Content-Type: text/plain; charset=iso-8859-1<br>
<br>
Thanks to all the responders. It gave me some ideas, but alas no luck.<br>
<br>
To clarify, I am not trying to do everything in one request. Request<br>
one generates the page, a user event (selecting an option from a form)<br>
fires another request via javascript.<br>
<br>
like:<br>
&lt;script tal:content=&quot;python:'function getFormats() {<br>
 &nbsp; &nbsp;var widget = document.getElementById('orgs');<br>
 &nbsp; &nbsp;var chosen_org = widget.options[widget.selectedIndex].value;<br>
 &nbsp; &nbsp;var formats = %s;<br>
 &nbsp; &nbsp;// build selection 2 options from formats<br>
 &nbsp; &nbsp;' % here.getDataFormats(chosen_org)&quot; /&gt;<br>
<br>
And then a user event (onChange) calls getFormats.<br>
<br>
Even with generating the script with a Python script or DTML, the<br>
problem remains (for me at least) to get a value from the DOM passed as<br>
an argument to a Python script that queries my database. If my Python<br>
script didn't take an argument, I'd have no problem. I could do this<br>
and use javascript to build the select options from the appropriate<br>
values. But I'd like to cut down on what the browser has to handle.<br>
What the user chooses in the first selection can reduce what they get<br>
to choose in selection two from 3000 choices to hundreds. I'd prefer to<br>
have the backend reduce the result set rather than having the browser<br>
do the work.<br>
<br>
I thought about AJAX (no experience), but given time constraints, looks<br>
like I'll have to load everything on the page and go from there.<br>
<br>
Rob<br>
</div></div>