Call variable php with javascript

Salam alykom


    $jour = je::model()->find('id = :Id', array('Id' => $_POST['journey']));

    $or = $jour->Origin;

    $des = $jour->Destination;



 <input  name="Or" id="Or" value="<?php echo $jour->Origin; ?>" />

    <input type="hidden" name="des" id="des" value="<?php echo $jour->Destination; ?>" />

that’s my dropdownliste :

  echo CHtml::dropDownList('journey', '', $data, array('id' => 'journey', 'prompt' => yii::t('main', 'Select'),  'class' => 'required'));

i need the code javascript for when i select this dropdownliste will the values which are in input id="Or" and id="des" change also.

i need the code of java, i don’t know how to use it :

<!--<script language="javascript">



// i don't know how to call this code : $jour = je::model()->find('id = :Id', array('Id' => $_POST['journey']));

   // $or = $jour->Origin;

   // $des = $jour->Destination;




if ther’s other way please help me.

wa alikom al Salam,

this link will be usefull:

i hope it will solve your problem :)