Search code examples
jqueryevent-handlingactivescaffold

ActiveScaffold: attach JQuery Javascript event to newly-opened subform


I want to attach a JQuery function to an input field in an update form. The form is standard ActiveScaffold, opened by clicking on the Edit link in the list view. How do I register the function -- what event signals that the subform has been opened and the DOM is ready? A new page has not been loaded so the onload() function doesn't do it.


Solution

  • Use the .live() method, and you do not have to know when the element actually gets attached.