title: ASP MVC 3: How can I do Client side Validation on a Select List?
body: <p>After reading a few question/answers here I have managed to work out how to add a Select list to a form and fill it with data, like so:</p>
  
  <pre><code>@Html.DropDownList("S", new SelectList(ViewBag.S, "Id", "Nme"), "-- Sel a S --")
  </code></pre>
  
  <p>And it works perfectly. However I would like to add some <em>client-side Validation</em> To validate whether the user has selected an option and not left it at the Default.</p>
  
  <p>I'm using the standard jquery stuff that comes with mvc 3, so presumably I have to do something with HTML.ValidationMessage, but what? </p>
  
  <p>And Can't for the life of me work out how.</p>
  
  <p>TIA.</p>
  
  <p>Ok I had a look through how its done in JQuery land and found just by adding an htmlattribute like so:</p>
  
  <pre><code>new {@class='required'}
  </code></pre>
  
  <p>to my Html.DropDownList statement, and adding validationMessage, fixes the problem for me.</p>