I finally got it working with this javascript. Took me 6 hours,
though. I think I need a lot more practice and a
Javascript book. ;-)
Thanks for the help, Diez.
=====================
<script>
var conn = MochiKit.Signal.connect;
function replace_project(req) {
var projects = evalJSONRequest(req).projects;
replaceChildNodes($("myform_projects"), map( function(p) { return
OPTION((p.id,p.projectDesc))},projects ));
}
function client_id_changed(event) {
var client_id = event.target().value;
var def = doSimpleXMLHttpRequest('/get_projects', {client_id :
client_id});
def.addCallback(replace_project)
}
function init_client_selector() {
conn(currentDocument().forms['myform'].elements['myform_client_id'],
'onchange', client_id_changed);
};
conn(window, 'onload', client_id_changed);
conn(window, 'onload', init_client_selector);
</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---