Hello friend i want to make file upload with CMultiFileUpload and ajax. I have made for form and controller, but i’m confused for render information throughout ajax.
My view
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'upload',
'enableAjaxValidation' => false,
'action' => '/prototipe/index.php?r=upload/upload',
'enableClientValidation' => true,
'htmlOptions' => array('enctype' => 'multipart/form-data'),
'clientOptions' => array(
'validateOnSubmit' => true,
),
));
?>
<?php
$this->widget('CMultiFileUpload', array(
'name' => 'files',
'accept' => 'jpg',
'max' => 1,
'remove' => Yii::t('ui', 'Hapus'),
//'denied'=>'', message that is displayed when a file type is not allowed
//'duplicate'=>'', message that is displayed when a file appears twice
'htmlOptions' => array('size' => 25),
));
?>
<?php if (CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model, 'CHAPTCA'); ?>
<div>
<?php $this->widget('CCaptcha'); ?>
<div class="row">
<?php echo $form->textField($model, 'CHAPTCA'); ?>
</div>
</div>
<?php echo $form->error($model, 'CHAPTCA'); ?>
</div>
<?php endif; ?>
<div class="row buttons">
<?php
echo CHtml::submitButton('Unggah', array(
'id' => 'uggahButton',
)
);
?>
</div>
<?php $this->endWidget(); ?>
</div>
Do you have solution, i use chaptcha in my form