title: PHP form validation drop down, display "required" if user doesnt have an input. Prevent reset of the dropdown value
body: <p>I need help with form validation. I can get it to work with text boxes but I am having trouble validating drop down lists.</p>
  
  <p>I have included a part of my php code plus the code that is imbedded in the HTML</p>
  
  <p>I am having trouble displaying the required text next to the drop down list. Also how would I display the user selected option if the user forgets to enter an input elsewhere on the form so it doesn't reset the dropdown field and show what the user had already had selected. </p>
  
  <pre><code>&lt;?php     
  if(empty($_POST['title']))
              {
                  $errors['title1'] = " Required";
              }
      &lt;p&gt;
  
  ?&gt;
          &lt;label for="title" class="label"&gt;&lt;font color="#040404"&gt;Title:&lt;/font&gt;&lt;/label&gt;
                          &lt;select name="title"&gt;
                              &lt;option value="" selected="selected"&gt;Select title&lt;/option&gt;
                              &lt;option value ="Mr"&gt;Mr&lt;/option&gt;
                              &lt;option value ="Mrs"&gt;Mrs&lt;/option&gt;
                              &lt;option value="Ms"&gt;Ms&lt;/option&gt;
                              &lt;option value="Miss"&gt;Miss&lt;/option&gt;
                              &lt;option value="Dr"&gt;Dr&lt;/option&gt;
                              &lt;/select&gt;                   
  
      &lt;/p&gt;
  </code></pre>