Yii Framework Forum: مشکل در Ajax - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

مشکل در Ajax

#1 User is offline   mehdinys 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 09-October 13

Posted 19 April 2014 - 01:54 AM

سلام
من میخوام در فرممو بصورت ajaxValidate کنم و بصورت ajax هم ارسال کنم ولی وقتی ajaxSubmitButton میزارم ajaxValidate کار نمیکنه !
view :


<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>
<meta charset="utf-8">
<div class="form">
 
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'user-form',
    // Please note: When you enable ajax validation, make sure the corresponding
    // controller action is handling ajax validation correctly.
    // There is a call to performAjaxValidation() commented in generated controller code.
    // See class documentation of CActiveForm for details on this.
    'enableAjaxValidation'=>true,
    
     'clientOptions'=>array(
        'validateOnSubmit'=>true,
         'validateOnChange' => false
         ),
)); ?>
 
    <p class="note">Fields with <span class="required">*</span> are required.</p>
 
    <?php echo $form->errorSummary($model); ?>
 
    <div class="row">
        <?php echo $form->labelEx($model,'name'); ?>
        <?php echo $form->textField($model,'name',array('size'=>15,'maxleng  th'=>15)); ?>
        <?php echo $form->error($model,'name'); ?>
    </div>
 
    <div class="row">
        <?php echo $form->labelEx($model,'age'); ?>
        <?php echo $form->textField($model,'age'); ?>
        <?php echo $form->error($model,'age'); ?>
    </div>
 
    <div class="row">
        <?php echo $form->labelEx($model,'tell'); ?>
        <?php echo $form->textField($model,'tell'); ?>
        <?php echo $form->error($model,'tell'); ?>
    </div>
 
    <div class="row buttons">
        <?php echo CHtml::ajaxSumitButton('send', $this->createUrl('user/Create') , array('update' => '#div')) ?>
    </div>
 
<?php $this->endWidget(); ?>
 
</div><!-- form -->

0

#2 User is offline   mjm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 07-May 14

Posted 23 May 2014 - 11:25 AM


سلام
قسمتی که
<?php echo CHtml::ajaxSumitButton('send', $this->createUrl('user/Create') , array('update' => '#div')) ?>
کردی
ارایه array('update' => '#div')
#div
ای دی تگیه که میخوای با ajax تغییر پیدا کنه
تو همچین تگی نداری

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users