What's the corresponding jQuery event when the wrapper of file field got replaced after the file uploaded???

Thanks in advance.

Comments

happydrupal’s picture

Status: Active » Closed (fixed)

Thanks for the #drupal IRC support, I found the solution. Just write a form_alter module and combine Drupal.behaviors will do. And myBehavior will run everytime once AHAH update the filefield wrapper.

function myModule_form_alter(&$form, $form_state, $form_id) {
    if ($form['form_id']['#id'] == 'edit-myNode-form') {
       drupal_add_js(
            'Drupal.behaviors.myBehavior = function () {
                // my fancy java and jQuery code goes here;
                };',
             'inline' 
             );	
        }