title: Form Validation - IF field is blank THEN automatically selection option
body: <p>I need help to automatically select an option to submit with a form:
  When the 'form-email' field is blank i want it to select 'option 1' and, 
  When the field is not blank i want it to select 'option 2'.</p>
  
  <p>Here's my form code</p>
  
  <pre><code>&lt;form method="post" onsubmit="return validate-category(this)" action="tdomf-form-post.php" id='tdomf_form1' name='tdomf_form1' class='tdomf_form'&gt; 
  
      &lt;textarea title="Post Title" name="content-title-tf" id="form-content" &gt;Say it...&lt;/textarea&gt;
  
      &lt;input type="text" value="" name="content-text-ta" id="form-email"/&gt;
  
      &lt;select name='categories' class='form-category' type="hidden"&gt; 
          &lt;option value="3" type="hidden"&gt;Anonymous&lt;/option&gt; 
          &lt;option value="4" type="hidden" selected="selected"&gt;Competition&lt;/option&gt; 
      &lt;/select&gt;
  
      &lt;input type="submit" value="Say it!" name="tdomf_form1_send" id="form-submit"/&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>I have an idea that the javascript would go something like this, but can't find what the code is to change the value.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function validate-category(field)
  {
  with (field)
    {
    if (value==null||value=="")
      {
      select category 1
      }
    else
      {
      select category 2
      return true;
      }
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Any help on this would be great.</p>
  
  <p>Thanks in advance.</p>