title: HTML selecting last selected dropdown value?
body: <p>I'm dealing with a registration form at the moment, specifically, I'm dealing with redisplaying any information the user enters into the inputs if there is an error in the registration verification.</p>
  
  <p>Normally, when a user hits 'submit' - if there is an error, the page refreshes and they are echoed out and the form is redisplayed. The problem is there is sometimes genuinely valid information in some of the fields, and by regrabbing that data, it can be redisplayed using the value attribute and the <code>isset()</code> function like so (if of course that data has been POSTed, which in this case it has):</p>
  
  <pre><code>&lt;input type="email" name="anEmail" 
                     value=" &lt;?php echo (isset($email)) ? $email : false; ?&gt;" /&gt;
  </code></pre>
  
  <p>That works fine for the <code>&lt;input&gt;</code> element, but is the same achievable with a dropdown list through the <code>&lt;select&gt;</code> element? </p>
  
  <p>I initially tried:</p>
  
  <pre><code>&lt;select name="region" 
         value="&lt;?php echo (isset($region)) ? $region : 'Auckland'; ?&gt;" &gt; 
  
  &lt;!-- with 'Auckland' being the default value of the list --&gt;
  </code></pre>
  
  <p>However, <a href="http://www.w3schools.com/tags/tag_select.asp" rel="nofollow">it doesn't seem like</a> that <code>value=""</code> is a valid attribute for the <code>&lt;select&gt;</code> tag. </p>
  
  <p>Any ideas on how I could accomplish this? Cheers. </p>