Steve Bergman schrieb: > I just put up a howto on this on the RoughDocs wiki if anyone would > care to look it over for accuracy. I *think* I explained it correctly. > > http://docs.turbogears.org/1.0/RoughDocs/dynamicform > > One thing that I'm not sure of is why > > 'conn(currentDocument().forms['myform'].elements['myform_client_id'], > 'onchange', client_id_changed);' > > can't just be registered directly without putting it in a function > called at 'onload' time. I'm thinking it is because the form element > that is being registered does not exist until after the page has > loaded. Is that correct? >
Yes and no. You are right that the attachment of the handler to the event has to be done after the page is fully loaded, as otherwise the form doesn't exist. However, the above line is superfluous: you have to register init_client_selector, client_id_changed you don't need. If you want to invoke client_id_changed upon page loading, to setup things properly initially, I'd just put a call to it to init_client_selector. Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

