title: MVC @Html.TextAreaFor validation not working
body: <p>I'm having an issue on a form that has textBox and textArea. This forum is in a shared view. The textBox's are validating but the textArea's are not. I've gone through a lot of issues other people have faced and haven't seemed to be able to resolve it. I created another form in my application and the validation worked on the textArea</p>
  
  <p>The form is a dynamically created questions page. </p>
  
  <pre><code>@for (var i = 0; i &lt; Model.QuestionAnswers.Count; i++)
  {
          @switch (Model.QuestionAnswers[i].QuestionType)
          {
              case QuestionTypeEnum.SentenceRequired:
                  @Html.TextAreaFor(m =&gt; m.QuestionAnswers[i].Answer, 5, 20, new { @class = "input-xlarge persistLocal",
                  required = "required" })
                  break;
  
  
              case QuestionTypeEnum.TextBoxRequired:
                  @Html.TextBoxFor(m =&gt; m.QuestionAnswers[i].Answer, new {@class = "input-xlarge persistLocal", required = "required" })
                  break;
           }
  }
  </code></pre>
  
  <p>This is my model, i'm not using a attributes on the model, as when im generating the form, some of the questions are not required. and i have tried this and it still not working. </p>
  
  <pre><code> public class QuestionAnswerViewModel
  {
  
      public List&lt;QuestionAnswer&gt; QuestionAnswers { get; set; }
  }
  
  /// &lt;summary&gt;
  /// 
  /// &lt;/summary&gt;
  public class QuestionAnswer
  {
      public string Answer { get; set; }
  
      public string Question { get; set; }
  
      public int PermitRequestTypeQuestionId { get; set; }
  
      public QuestionTypeEnum QuestionType { get; set; }
  
      public int AnswerId { get; set; }
  
  
      [DisplayName("Question")]
      public string QuestionAndAnswerText
      {
          get { return string.Format("{0} &lt;strong&gt;{1}&lt;/strong&gt;", Question, Answer); }
      }
  }
  </code></pre>
  
  <p>This is a screen shot of my forum</p>
  
  <p><a href="https://i.stack.imgur.com/rZHKf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rZHKf.png" alt="Forum"></a></p>
  
  <p>These are the scripts that are loaded into the view</p>
  
  <p><a href="https://i.stack.imgur.com/rylKu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rylKu.png" alt="enter image description here"></a></p>
  
  <p>In the parent view i've tried adding this to try force the validation
       $.validator.unobtrusive.parse("#formName");</p>
  
  <p>This is the output on the console
  <a href="https://i.stack.imgur.com/FjEJP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FjEJP.png" alt="enter image description here"></a></p>
  
  <p>I thought maybe it was some white space between the two textarea tags but it doesn't seem to be and there's no errors in the javascript console window, and as i said earlier, it is working for a textbox. I've also tried changing it to a EditFor and changed the model property to use the multiline attribute and required attribute and still no joy. </p>
  
  <p>Any help in the right direction would be greatly appreciated, thanks</p>