title: Display only required DDL value in Edit screen in MVC
body: <p>When I use the JS code below in create view in MVC it works perfect. However I've tried to alter it so that when in edit view it should still only display the textbox when "OtherSpecifyFormGroup" is selected from the create screen. Any help would be great!!</p>
  
  <pre><code>&lt;script&gt;
          $(document).ready(function () {
              //this line fires no matter what
              $("#OtherSpecifyFormGroup").hide();            
              $("#SelectType").change(function () {
                  //alert("in function");
                  var value = document.getElementById("SelectType").value;
                  if (value == "4") {
                      $("#OtherSpecifyFormGroup").show("highlight", { color: "#7FAAFF" }, 1000);
                  }
                  else {
                      $("#OtherSpecifyFormGroup").hide();
                  }
              });
          })
      &lt;/script&gt;
  </code></pre>
  
  <p>HTML code</p>
  
  <pre><code>&lt;div class="form-group"&gt;
                      @Html.LabelFor(model =&gt; model.SelectType, "Select Type", new { @class = "control-label col-md-5" })
                      &lt;div class="col-md-1"&gt;
                          @Html.DropDownList("SelectType", String.Empty)
                          @Html.ValidationMessageFor(model =&gt; model.SelectType)
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group" id="OtherSpecifyFormGroup"&gt;
                      @Html.LabelFor(model =&gt; model.OtherSpecify, new { @class = "control-label col-md-5" })
                      &lt;div class="col-md-4 sbchanged"&gt;
                          @Html.TextBoxFor(model =&gt; model.OtherSpecify)
                          @Html.ValidationMessageFor(model =&gt; model.OtherSpecify)
                      &lt;/div&gt;
                  &lt;/div&gt;
  </code></pre>