title: SelectList with Mechanize in Ruby
body: <p>I'm trying to set the value of a select list using Mechanize with Ruby. I can navigate to the page with the select list, grab the form using the .form method, and find the select list.</p>
  
  <pre><code>report_form =page.form('form1')
  pp report_form.field_with(:name =&gt; "report_type")
  </code></pre>
  
  <p>Correctly returns the right object.</p>
  
  <p>However, I'm still unable to set the value of this field! I've tried:</p>
  
  <pre><code>report_form.field_with(:name =&gt; "report_type").options.first.select
  report_form.field_with(:name =&gt; "report_type").options[1].select
  report_form.field_with(:name =&gt; "report_type").value = "Foo"
  </code></pre>
  
  <p>But when I then do:</p>
  
  <pre><code>pp report_form.field_with(:name =&gt; "report_type")
  </code></pre>
  
  <p>The value field is still empty.</p>
  
  <p>Is there something I'm missing? Tips? Tricks? Better Mechanize docs than what live at <a href="http://mechanize.rubyforge.org" rel="noreferrer">http://mechanize.rubyforge.org</a>?</p>
  
  <p>Thanks!</p>
  
  <p>Edit: The relevant HTML is:
  The relevant HTML is:</p>
  
  <pre><code>&lt;TD&gt;
  &lt;select id="report_type" name="report_type"&gt;
      &lt;option value="Foo1"&gt;Opt 1&lt;/option&gt;
      &lt;option value="Foo2"&gt;Opt 2&lt;/option&gt;
      &lt;option value="Foo3"&gt;Opt 3&lt;/option&gt;
  &lt;/select&gt;&lt;/TD&gt;
  </code></pre>