title: Yii2 HTML helper input make required
body: <p>I have form generated with <a href="http://www.yiiframework.com/doc-2.0/guide-helper-html.html" rel="nofollow">HTML helper</a>:</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class='form-group col-lg-6 col-sm-6'&gt;
      &lt;?= HTML::label('Name:','PropertyContactsNew',['class' =&gt; 'control-label']); ?&gt;
      &lt;?= HTML::textInput("PropertyContactsNew[{$slug_other_contacts}][name][]", '', ['maxlength' =&gt; 50, 'class'=&gt;'form-control']) ?&gt;
    &lt;/div&gt;
    &lt;div class='form-group col-lg-6 col-sm-6'&gt;
      &lt;?= HTML::label('Company:','PropertyContactsNew',['class' =&gt; 'control-label']); ?&gt;
      &lt;?= HTML::textInput("PropertyContactsNew[{$slug_other_contacts}][company][]", '', ['maxlength' =&gt; 100, 'class'=&gt;'form-control']) ?&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a way mark form fields required and prevent form from submitting in case the it is empty, just like the ActiveForm does (I can not use ActiveForm for some reasons) or should I use js library to do this?</p>