title: change the value of a select tag using jquery
body: <p>I am working on a wordpress site. I have an html with select tag and some options. When the form is submitted, I want to replace the value of option 'Other' with this value 'Rosemont'  if option 'Other' is selected. Below is my html.</p>
  
  <pre><code>&lt;select class="expand" name="field_19" id="field_19"&gt;
                                          &lt;option value="Bryn Mawr"&gt;Bryn Mawr&lt;/option&gt;
                                          &lt;option value="Devon"&gt;Devon&lt;/option&gt;
                                          &lt;option value="Gladwyne"&gt;Gladwyne&lt;/option&gt;
                                          &lt;option value="Haverford"&gt;Haverford&lt;/option&gt;
                                          &lt;option value="Other"&gt;Other&lt;/option&gt;
                                          &lt;/select&gt;
  </code></pre>
  
  <p>Now I want that if the option 'Other' is selected then the selected value should be changed to text 'Rosemont'. So that the value 'Rosemont' should be saved into the database instead of 'Other'.  I have written some jquery code but its not working.
  Here is my code</p>
  
  <pre><code> jQuery(function(){
      jQuery('#signup_submit').click(function(){
      var city_name = jQuery('select[name="field_19"]').val();
      alert(city_name)// this alerts 'Other'
      if(city_name=='Other'){
      valr = 'Rosemont';
      jQuery('select[name="field_19"]').val(valr);
      var vals = jQuery('select[name="field_19"]').val();
      alert(vals);// again this alerts 'Other'. this should alert Rosemont
  }
      });
  </code></pre>