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]); }