Created
June 11, 2015 08:40
-
-
Save beatcode/de62ea611049877f0fe4 to your computer and use it in GitHub Desktop.
Yii2 onchange Ajax Event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?= $form->field($model, 'IDProdukt')->dropDownList(ArrayHelper::map(TblProdukte::find()->all(), 'ID', 'Produkt'), | |
['prompt' => '-Produkt wählen-', | |
'onchange' => ' | |
$.get( "index.php?r=buchung/getprice&id="+$(this).val(), function( data ) { | |
$( "#tblbuchung-preis" ).val( data ); | |
}); | |
']); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment