title: MVC 5 Hide Text Box
body: <p>I have a form created in MVC 5.  There is a text box below:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Client_PID, htmlAttributes: new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
  
            @Html.EditorFor(model =&gt; model.Client_PID,   new { htmlAttributes = new { @class = "form-control" }  } )
            @Html.ValidationMessageFor(model =&gt; model.Client_PID, "", new { @class = "text-danger" })
  
        &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to make this for conditionally invisible with a default value, else to be filled in by the customer.</p>
  
  <p>What is the best way to accomplish this.  I have been able to make the text box invisible conditionally, but then my form fails,
   if (ModelState.IsValid) is not valid...how do I pass a default value into this?</p>