function cck_select_other_post_render in CCK Select Other 6
Same name and namespace in other branches
- 7 cck_select_other.module \cck_select_other_post_render()
Post-render callback to add javascript functionality
Parameters
$form:
Return value
$form
1 string reference to 'cck_select_other_post_render'
- cck_select_other_elements in ./
cck_select_other.module - Implementation of hook_elements
File
- ./
cck_select_other.module, line 277 - Implements a select list widget that lets a user provide an alternate option.
Code
function cck_select_other_post_render($content, $elements) {
static $js;
$field_name = substr($elements['#field_name'], 6);
if (!$js) {
drupal_add_js(array(
'CCKSelectOther' => array(
'field' => $field_name,
),
), 'setting');
drupal_add_js(drupal_get_path('module', 'cck_select_other') . '/cck_select_other.js');
$js = TRUE;
}
else {
drupal_add_js(array(
'CCKSelectOther' => array(
'field' => $field_name,
),
), 'setting');
}
return $content;
}