Cmultifileupload In Cjuidialog

Hey, I have two models.

In one of them I want to create a new entry and to add images which are located in the second model.

So I created a CJuiDialog to add those. In this CJuiDialog I load the _form of the other model.

The thing is, after submitting the form, the action of the image model is loaded.

I tried this, but it didn’t work for me. It sends the Submit to the _form where I called the CJuiDialog.


<?php echo CHtml::submitButton('Submit2',array('submit' => Yii::app()->controller->createUrl('image/addnew'),'render'=>false)); ?>

Also I have different results, when add or remove this line in my controller.


Yii::app()->clientScript->scriptMap['jquery.js'] = false;

Then cmultifile javascript is missing.

I load the cjuidialog like this, which is rendered partial in imageController action uploadPic.php and this renders the form _formPic.php with the CMultiFileUpload. This works, but it loads then image/addnew.


<?php echo CHtml::ajaxLink(Yii::t('job','Create Job'),$this->createUrl('image/addnew'), 

			array('data' => array('myID'=>'js:$("#item_id").val()',

					 'YII_CSRF_TOKEN' => Yii::app()->request->csrfToken),

					'type' => 'POST',

        //'onclick'=>'$("#picDialog").dialog("open"); return false;',

        'update'=>'#picDialog',

        ),array('id'=>'showPicDialog'));?>

        

    <div id="picDialog"></div>

Please Help me there.