? .svn
? cck_select_other-js.patch
? tests/.svn
Index: cck_select_other.js
===================================================================
RCS file: cck_select_other.js
diff -N cck_select_other.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cck_select_other.js	22 Mar 2010 20:24:52 -0000
@@ -0,0 +1,39 @@
+//$Id$
+
+/**
+ *  cck_select_other javascript file 
+ */
+
+var cckSelectOther = {};
+
+Drupal.behaviors.cckSelectOther = function (context) {
+
+//  $.browser.msie == true ? $(this).click(Drupal.ConditionalFields.fieldChange) : $(this).change(Drupal.ConditionalFields.fieldChange); 
+
+  $.browser.msie == true ? $(this).click(cckSelectOther.blah) : $(this).change(cckSelectOther.blah);
+
+  var selectId = 'edit-field-'+Drupal.settings.CCKSelectOther.field+'-select-other-list';
+  var inputId = 'edit-field-'+Drupal.settings.CCKSelectOther.field+'-select-other-text-input-wrapper';
+  var value = $('#'+selectId+' option:selected').val();
+
+  if (value == "other") {
+    document.getElementById(inputId).style.display = 'block';
+  }
+  else {
+    document.getElementById(inputId).style.display = 'none';
+  }
+
+}
+
+cckSelectOther.blah = function () {
+  var selectId = 'edit-field-'+Drupal.settings.CCKSelectOther.field+'-select-other-list';
+  var inputId = 'edit-field-'+Drupal.settings.CCKSelectOther.field+'-select-other-text-input-wrapper';
+  var value = $('#'+selectId+' option:selected').val();
+
+  if (value == "other") {
+    document.getElementById(inputId).style.display = 'block';
+  }
+  else {
+    document.getElementById(inputId).style.display = 'none';
+  }
+}
Index: cck_select_other.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck_select_other/cck_select_other.module,v
retrieving revision 1.1.2.10
diff -u -p -r1.1.2.10 cck_select_other.module
--- cck_select_other.module	22 Mar 2010 20:02:47 -0000	1.1.2.10
+++ cck_select_other.module	22 Mar 2010 20:24:52 -0000
@@ -55,6 +55,7 @@ function cck_select_other_elements() {
       '#delta' => 0,
       '#process' => array('cck_select_other_process'),
       '#pre_render' => array('cck_select_other_pre_render'),
+      '#post_render' => array('cck_select_other_post_render'),
       ),
     );
 }
@@ -177,15 +178,24 @@ function cck_select_other_options($field
  * @return $form
  */
 function cck_select_other_pre_render($form) {
+  static $js;
 
   if (isset($form['select_other_list'])) {
     return $form; 
   }
+
+  $field_name = substr($form['#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;
+  }
+
   unset($form['#default_value']);
   unset($form['#value']);
 
   $field = content_fields($form['#field_name']);
-	$field_name = substr($form['#field_name'], 6);
   $def = $form['#post'][$form['#field_name']]['select_other_text_input'];
   $select_def = $form['#post'][$form['#field_name']]['select_other_list'];
   $delta = $form['#delta'];
@@ -227,3 +237,22 @@ function cck_select_other_pre_render($fo
 
   return $new_form;
 }
+
+/**
+ * Post-render callback to add javascript functionality
+ * @param $form
+ * @return $form
+ */
+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;
+  }
+
+  return $content;
+}
