<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -260,13 +260,15 @@ RecordSelect.Single.prototype = Object.extend(new RecordSelect.Abstract(), {
     this.container = this.create_container();
     this.container.addClassName('record-select-autocomplete');
 
-    // create the hidden input
-    new Insertion.After(this.obj, '&lt;input type=&quot;hidden&quot; name=&quot;&quot; value=&quot;&quot; /&gt;')
+    // We are doing this in the record_select_field so that we can observe the field
+    // // create the hidden input
+    // new Insertion.After(this.obj, '&lt;input type=&quot;hidden&quot; name=&quot;&quot; value=&quot;&quot; /&gt;')
     this.hidden_input = this.obj.next();
 
-    // transfer the input name from the text input to the hidden input
-    this.hidden_input.name = this.obj.name;
-    this.obj.name = '';
+    // We want control over submitting the temp field.
+    // // transfer the input name from the text input to the hidden input
+    // this.hidden_input.name = this.obj.name;
+    // this.obj.name = '';
 
     // initialize the values
     this.set(this.options.id, this.options.label);</diff>
      <filename>assets/javascripts/record_select.js</filename>
    </modified>
    <modified>
      <diff>@@ -55,7 +55,30 @@ module RecordSelect
 
       url = url_for({:action =&gt; :browse, :controller =&gt; options[:controller], :escape =&gt; false}.merge(options[:params]))
 
-      html = text_field_tag(name, nil, :autocomplete =&gt; 'off', :id =&gt; options[:id], :class =&gt; options[:class], :onfocus =&gt; &quot;this.focused=true&quot;, :onblur =&gt; &quot;this.focused=false&quot;)
+      name_temp = name.dup
+      name_temp[name_temp.length - 1, 0] = &quot;_temp&quot;
+      html = text_field_tag(name_temp, nil, :autocomplete =&gt; 'off', :id =&gt; options[:id], :class =&gt; options[:class], :onfocus =&gt; &quot;this.focused=true&quot;, :onblur =&gt; &quot;this.focused=false&quot;, :style =&gt; options[:style])
+      html &lt;&lt; hidden_field_tag(name, id, :id =&gt; options[:id] + &quot;_hidden&quot;)
+      html &lt;&lt; javascript_tag(&quot;new RecordSelect.Single(#{options[:id].to_json}, #{url.to_json}, {id: #{id.to_json}, label: #{label.to_json}, onchange: #{options[:onchange] || ''.to_json}});&quot;)
+
+      return html
+    end
+
+    def record_select_field_not_by_id_column(name, current, options = {})
+      options[:params] ||= {}
+      options[:id] ||= name.gsub(/[\[\]]/, '_')
+
+      controller = assert_controller_responds(options[:controller])
+
+      id = label = ''
+      if current
+        id = label = current
+      end
+
+      url = url_for({:action =&gt; :browse, :controller =&gt; options[:controller], :escape =&gt; false}.merge(options[:params]))
+
+      html = text_field_tag(name.gsub(&quot;]&quot;, &quot;_temp]&quot;), nil, :autocomplete =&gt; 'off', :id =&gt; options[:id], :class =&gt; options[:class], :onfocus =&gt; &quot;this.focused=true&quot;, :onblur =&gt; &quot;this.focused=false&quot;, :style =&gt; options[:style])
+      html &lt;&lt; hidden_field_tag(name, id, :id =&gt; options[:id] + &quot;_hidden&quot;)
       html &lt;&lt; javascript_tag(&quot;new RecordSelect.Single(#{options[:id].to_json}, #{url.to_json}, {id: #{id.to_json}, label: #{label.to_json}, onchange: #{options[:onchange] || ''.to_json}});&quot;)
 
       return html</diff>
      <filename>lib/record_select/helpers.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>85ff0c4153e3590c4dc656b456ac055afc894f72</id>
    </parent>
  </parents>
  <author>
    <name>Edwin Moss</name>
    <email>edwin.moss@gmail.com</email>
  </author>
  <url>http://github.com/edwinmoss/recordselect/commit/290693a434e96b1577c95a9b71e2ebfdbfc62712</url>
  <id>290693a434e96b1577c95a9b71e2ebfdbfc62712</id>
  <committed-date>2009-02-04T19:54:00-08:00</committed-date>
  <authored-date>2009-02-04T19:54:00-08:00</authored-date>
  <message>Add record_select_field_not_by_id_column.</message>
  <tree>1a91ebea0f40aa19af88510d66f7c3b4c17f800c</tree>
  <committer>
    <name>Edwin Moss</name>
    <email>edwin.moss@gmail.com</email>
  </committer>
</commit>
