renderPartial stripping out JS even when $processOutput = True

renderPartial stripping out Javascript even when $processOutput = True,

Partial view of the category selection.


        <?php

            

            $prodCat = $model['m']['ProdCat'][$i];

            $prodCatList = $model['catList'];

            


        ?>

<?php echo $form->labelEx($prodCat,'cat_id'); ?>

	<div class="row" id="cat-<?php echo $i ?>">

            <?php $j = $i +1; ?>

		

		<?php echo $form->dropDownList($prodCat,"[$i]cat_id", $prodCatList, array('class'=>'drop-list', 'ajax'=>array('url'=>CController::createUrl('admin/ajaxAddCategory'), 'replace'=>"#cat-$j", 'data'=>array('i'=>$j), 'type'=>'post'))); ?>

		<?php echo $form->error($prodCat,'cat_id'); ?>


	</div>

        <?php $i++ ?>


        <div class="row" id="cat-<?php echo $i ?>">

           

         </div>

Admin controller


public function actionAjaxAddCategory()

    {

        $model['i'] = $_POST['i'];

        $i = $_POST['i'];

        $model['catList'] = CategoryPath::Main();

        $model['ajax']['addCat'][$i] = new ProdCat();

        $this->renderPartial('//admin/Products/_prodCatAjax', array('model'=>$model), false, true);

    }

view _prodCatAjax


     

<?php

$i=$model['i'];

            $prodCat = $model['ajax']['addCat'][$i];

            $prodCatList = $model['catList'];


        ?>

	  

            <?php $j = $i +1; ?>

<div class="row" id="cat-<?php echo $i ?>"> 

		<?php //echo $form->labelEx($prodCat,'cat_id'); ?>

		<?php echo CHtml::activeDropDownList($prodCat,"[$i]cat_id", $prodCatList, array('class'=>'drop-list', 'ajax'=>array('url'=>CController::createUrl('admin/ajaxAddCategory'), 'replace'=>"#cat-$j", 'data'=>array('i'=>$j), 'type'=>'post'))); ?>

		<?php //echo $form->error($prodCat,'cat_id'); ?>


        

         

              <script> gets stripped</script>

           

        

	

        </div>

        <?php $i++  ?>

        <div class="row" id="cat-<?php echo $i ?>">


        </div>



Hi,

I reproduced your code in simplified form.

In response I have the js successfully returned and this js works.

Strangely, though, I don’t see any


<script>

section rendered at all with Firebug, but the script is working, so it IS rendered - is this the case you have?

If not, please provide simplified code that can be implemented easily to reproduce the problem or maybe someone else had the same problem as you have and will answer you before that :)

I use Source Chart for FF, it always shows all manipulation.My script wasn’t working on a drop down list change a Delete link was supposed to show it works on the first non manipulated element but didn’t work on any successive elements that’s when I noticed anything in a script tag was being stripped out.

Edit: I’ll try to use a real simple script and see what happens.