hi, friends
i have _form.php view which contain javascript function. in that function, i embeded php code into it,then run and the result work as well as i want. but when i separated that function to anther file, the php script is not run, but display only Remove link.
below is my javascript fucntion:
function addProduct() {
var ni = document.getElementById('divProduct');
var numi = document.getElementById('countLastInput');
var num = (document.getElementById('countLastInput').value -1)+ 2;
numi.value = num;
var newdiv = document.createElement('div');
var divIdName = num;
newdiv.setAttribute('id',divIdName);
newdiv.innerHTML = <?php echo $form->dropDownList($orderdetail,'product_id',CHtml::listData(Products::model()->findAll(),'product_id','product_name'),
array('empty' => '--- Choose---','name'=>'productorder[]')); ?>+<?php echo $form->textField($orderdetail,'qty', array('name'=>'qtyorder[]')); ?>+'<a href="#" onclick="removePhoto('+divIdName+')">Remove</a>';
ni.appendChild(newdiv);
}
Plz help me!!!