title: MVC EditorFor with Dropdownlist and Textbox
body: <p>I'm still new to MVC, I don't quite get how <code>EditorFor</code> works in MVC 5.</p>
  
  <p>I'm building a project based on an existing database, so it makes sense to use the Database First approach for the EF. I have no problem creating the model and the initial template, but there is one column in my database looks like this:</p>
  
  <pre><code>Plant ID    Leaf Color
  1           Green
  2           Yellow
  3           Green
  4           Red
  5           Green
  6           Purple
  </code></pre>
  
  <p>Since Green and Yellow are the more common colors for a plant's leaves,</p>
  
  <ol>
  <li><p>First part of the question: I want to create a DropDownList with the options: <code>Green, Yellow and Other</code>. (i.e. so if the color is Red, it should point to "other" in the DropDownList)</p></li>
  <li><p>Second Part of the question: Once that happen, or when the "other" was selected, a new <code>TextBox</code> will appear for the user to enter the color manually.</p></li>
  </ol>
  
  <p>Because of this, it also messes up the Model binding and the MVC Validation.</p>
  
  <p>In MVC 5, when creating a Template using <code>MVC Controller with read/write actions and views, using Entity Framework</code>, the <code>EditorFor</code> will automatically create a <code>TextBox</code> for this field. There is no problem with the <code>Index.cshtml</code> and <code>Delete.cshtml</code> since they do not involve the <code>EditorFor</code>. However, the problem occurs in <code>Edit.cshtml</code> and <code>Create.cshtml</code>.</p>
  
  <p>How am I going to achieve what I need?</p>
  
  <p>Additional Info: I'm qutie familiar with jQuery, when doing ASP.NET WebForm, I know how to use jQuery to hide/show the Textbox, but I just don't seem to understand how to apply this to EditorFor and LabelFor</p>