I never tried, but I guess you can do it like that : $form['#attached']['js'] = array( array( 'data' => drupal_get_path('module', 'radio86_media') . '/select_media.js', 'type' => 'file' ), array( 'data' => array('radio86_media' => array('barfoo' => 'booboo')), 'setting' ) ); According the [documentation][1] you should be able to add settings and files. [1]: http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7#attached