title: Yii2. Form get Input Id
body: <p>I am trying to the ID of a field in order to use it in js. I have read Yii2 documentation and found ActiveField has a method "getInputId", but how do I call it?</p>
  
  <pre><code>&lt;?php $form = ActiveForm::begin(); ?&gt;
          &lt;?= $form-&gt;field($model, 'name')-&gt;textInput(['maxlength' =&gt; true]) ?&gt;
  &lt;?php $form-&gt;end(); ?&gt;
  </code></pre>
  
  <p>I can save the result from $form->field in a var, but it is a string so not possible to use it that way. </p>
  
  <p>I have been checking ActiveForm code and I see it exists 2 methods: beginField and endField, maybe soemthing to do with that? any ideas will be appreciated.</p>