Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Jquiry Removes <Form> In Cjuidialog Which Causes Empty Post

$
0
0
I use CJuiDialog to create new Member, but it removes <form> tag from the form, which causes that _POST['Member'] is empty. How can I add the <form> tag back, or work the issue around?

_form.php with CJuiDialog:


<div class="row">
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id' => 'teamsDialog',
'options' => array(
'title' => 'Добавить нового монтажника',
'width' => 500,
'height' => 650,
'autoOpen' => false,
'resizable' => false,
'modal' => true,
'ajaxRefresh'=>true,
'overlay' => array(
'backgroundColor' => '#000',
'opacity' => '0.5'
),
),
));
$model_teammember = new TeamMember();
echo $this->renderPartial('//teammember/_form_dialog', array('model' => $model_teammember));

$this->endWidget('zii.widgets.jui.CJuiDialog');

echo CHtml::link('Open Dialog', '#', array(
'onclick' => '$("#teamsDialog").dialog("open"); return false;',
));
?>

<div id="teamDialog"></div>


teammember/_form_dialog:


<div class="form" id="teamDialogForm">

<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'team-member-form',
'method' => 'post',
));
?>

.....................


<div class="row buttons">
<?php

echo CHtml::ajaxSubmitButton('Сохранить',
CHtml::normalizeUrl(array('teammember/addnew','render'=>false)),
array(
'type'=>'post',
'data'=>'js:$(".form").serialize()',

'success'=>'js: function(data) {
$("#Drivers_team_member_id").append(data);

}'),array('id'=>'closeTeammeberDialog'));

?>
</div>

<?php $this->endWidget(); ?>

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>