title: yii2 append data through renderAjax missing in post data
body: <p>I have two model A and B , In Model A form append Model B from dynamically,but when am click create button ,I am not getting model B data in POST.where I am doing wrong please help..</p>
  
  <p>Model A  Form(view)</p>
  
  <pre><code>       &lt;?php
          use yii\helpers\Html;
          use yii\widgets\ActiveForm;
          use yii\helpers\Url;
          use yii\web\View;
          $script = &lt;&lt;&lt; JS
  
          $.ajax({
          type     :'POST',            
          data: {total_form:1},
          cache    : true,
          url  : '/stag_str/web/index.php/activities/create',
          success  : function(data) {
          $('.p_scents').append(data);
          },
          });
  
          JS;
          $this-&gt;registerJs($script);
          ?&gt;
  
          &lt;div class="currency-form"&gt;
  
          &lt;?php $form = ActiveForm::begin(); ?&gt;
  
          &lt;?= $form-&gt;field($model, 'currency_name')-&gt;textInput(['maxlength' =&gt; true,'style'=&gt;'width:150px']) ?&gt;
          &lt;div class="p_scents"&gt;&lt;/div&gt;
          &lt;div class="form-group"&gt;
          &lt;?= Html::submitButton($model-&gt;isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' =&gt; $model-&gt;isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?&gt;
          &lt;/div&gt;
  
          &lt;?php ActiveForm::end(); ?&gt;
  
          &lt;/div&gt;
  </code></pre>
  
  <p>Model A controller</p>
  
  <pre><code>      public function actionCreate(){
          $model = new Currency();
  
          if ($model-&gt;load(Yii::$app-&gt;request-&gt;post())) {
          print_r($_POST);exit;
          return $this-&gt;redirect(['view', 'id' =&gt; $model-&gt;currency_id]);
          } else {
          return $this-&gt;render('create', [
          'model' =&gt; $model,
          ]);
          }
        }
  </code></pre>
  
  <p>Model B Form which  I am rendering through Ajax call</p>
  
  <pre><code>            &lt;?php
  
          use yii\helpers\Html;
          use yii\widgets\ActiveForm;
  
          /* @var $this yii\web\View */
          /* @var $model app\models\Activities */
          /* @var $form yii\widgets\ActiveForm */
          ?&gt;
  
          &lt;div class="activities-form"&gt;
  
           &lt;?php $form = ActiveForm::begin(['id' =&gt; 'activity' ]); ?&gt;
  
          &lt;?= $form-&gt;field($model, 'activity_name')-&gt;textInput(['maxlength' =&gt; true]) ?&gt;
  
          &lt;?php ActiveForm::end(); ?&gt;
  
          &lt;/div&gt;
  </code></pre>
  
  <p>Model B action using renderAjax</p>
  
  <pre><code>            public function actionCreate()
          {
              $model = new Activities();
  
              if ($model-&gt;load(Yii::$app-&gt;request-&gt;post()) &amp;&amp; $model-&gt;save()) {
                  return $this-&gt;redirect(['view', 'id' =&gt; $model-&gt;activity_id]);
          } elseif ( Yii::$app-&gt;request-&gt;isAjax ){
             return $this-&gt;renderAjax('_form', [
                  'model' =&gt; $model,
             ]);
          }
  
          }
  </code></pre>
  
  <p>I am not getting Model B form data while saving Model form A..</p>