0

I'm trying to make a form that changes the input according to the button pressed, using pjax of yii2, no page loads.

My view

<div id="container-ajax">
           
                 <?php Pjax::begin([]);  
                  echo $this->render('noleggia_andata', ['form' => $form, 'noleggi_partenza' => $noleggi_partenza]);

                Pjax::end(); ?>
             </div>

This is one, I tried with ActionView from Button but do not know how to do, can you give me any suggestions? View

<?= Html::a("Go", ['noleggi/noleggia_andata'], ['class' => 'btn-discard-orange']) */ ?>

Controller

 public function actionNoleggia_andata()
    {

    $noleggi_partenza = new Noleggi_partenza;

   return $this->render('noleggia_andata',['noleggi_partenza' => $noleggi_partenza]);
    }

Controller view rederAjax

public function actionNoleggia_andata() {

 $noleggi_partenza = new Noleggi_partenza;

return $this->renderAjax('noleggia_andata',['noleggi_partenza' => $noleggi_partenza]); }

enter image description here

Saba
  • 115
  • 1
  • 15
  • Any suggestions or advice for the way forward? – Saba Oct 24 '16 at 13:55
  • I'm sorry, I'm a little confused with your question. Can you provide more details? – Gynteniuxas Oct 24 '16 at 18:27
  • try this http://blog.neattutorials.com/examples/pjax/web/site/auto-refresh – Vishva G Oct 25 '16 at 06:28
  • In view "noleggi" there is a form I created but parts of the form change depending on the button pressed, i tried doing renderAjax but it does not read well the model,the two forms are not communicate. – Saba Oct 25 '16 at 09:01

0 Answers0