title: How to add Bootstrap Modal in Yii2?
body: <pre><code>&lt;div class="create-job-form"&gt;
      &lt;?php
      Modal::begin([
          'header' =&gt; '&lt;h4&gt;Job Created&lt;/h4&gt;',
          'id' =&gt; 'jobPop',
          'size' =&gt; 'modal-lg',
      ]);
  
      echo "&lt;div id='modalContent'&gt;&lt;/div&gt;";
      Modal::end();
      ?&gt;
      &lt;table width="5"&gt;
          &lt;?php $form = ActiveForm::begin(); ?&gt;
  
  
          &lt;fieldset&gt;
              &lt;legend&gt;Order Details&lt;/legend&gt;
              &lt;td&gt;
                  &lt;tr&gt; &lt;?= Html::activeHiddenInput($model, 'job_code', ['value' =&gt; rand(1, 10000)]) ?&gt; &lt;/tr&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;tr&gt;&lt;?= $form-&gt;field($model, 'job_description')-&gt;textInput(['maxlength' =&gt; true]) ?&gt;&lt;/tr&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;tr&gt;
                      &lt;?= $form-&gt;field($model, 'approved_date')-&gt;widget(
                          DatePicker::className(), [
                          // inline too, not bad
                          'inline' =&gt; true,
                          // modify template for custom rendering
                          'template' =&gt; '{input}',
                          'clientOptions' =&gt; [
                              'autoclose' =&gt; false,
                              'format' =&gt; 'dd-M-yyyy'
                          ]
                      ]); ?&gt;
  
                  &lt;/tr&gt;
              &lt;/td&gt;
  
              &lt;td&gt;
                  &lt;tr&gt;&lt;?= $form-&gt;field($model, 'estimated_time')-&gt;dropDownList(['24hrs' =&gt; '24 Hours', '48hrs' =&gt; '48 Hours', '2-3d' =&gt; '2-3 Days', '3-4d' =&gt; '3-4 Days', '4-5d' =&gt; '4-5 Days', '5-6d' =&gt; '5-6 Days'], ['prompt' =&gt; 'Select Time']) ?&gt;&lt;/tr&gt;
              &lt;/td&gt;
          &lt;/fieldset&gt;
      &lt;/table&gt;
      &lt;div class="form-group"&gt;
          &lt;?= Html::submitButton($model-&gt;isNewRecord ? 'Create' : 'Update', ['class' =&gt; $model-&gt;isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'id' =&gt; 'jobPop']) ?&gt;
      &lt;/div&gt;
  
      &lt;?php ActiveForm::end(); ?&gt;
  
  &lt;/div&gt;
  
  &lt;?php
  $script = &lt;&lt;&lt; JS
      $(function() {
          $('#jobPop').click(function () {
              $('#modal').modal('show')
                  .find('#modalContent')
                  .load($(this).attr('value'));
          });
      });
  JS;
  
      $this-&gt;registerJs($script);
      ?&gt;
  </code></pre>
  
  <p>This is my form, I'm trying to get Modal when click on create button, so that View will be on Modal. what i'm doing wrong?
  I need on form submit Modal should pop up and ask user Job has created do you want to send this information to client if user click yes then sms and email with above details should be send to client if user says no it should return to edit mode and the created job code should be flushed </p>
  
  <p>How to achieve this in Yii2?</p>