Ajax call on Field

Hi -

I have a basic form and I would like to associate an ajax call which is triggered when the field is modified. The code I used in Yii 1.x worked fine and looked like that:





	<?php echo $form->textFieldRow($post,'title',array('class'=>'span5',

		'maxlength'=>250,

		'ajax' => array(

			'type'=>'POST', 

			'url'=>CController::createUrl('app/generatePermalink'),

			'data'=>array('title'=>'js:this.value','device'=>'js:$("#Post_device_id :selected").text()'),

			'success'=>'function(data){

				$("#Post_permalink").val(data);}'

				)

				)); ?>







It takes some values of other fields of the form and then call the controller which returns a new value to update another field.

Can someone guide me to achieve the same in Yii2?

–Matt

If I am missing something obvious, feel free to point me to the documentation, this is perfectly fine.

Thank you

–Matt