Yii Framework Forum: Ajax Validation On Blur - Yii Framework Forum

Jump to content

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

Ajax Validation On Blur

#1 User is offline   Stephen51 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 09-May 12

Posted 03 October 2012 - 09:48 AM

In a form, I have an email field that is should be unique. I want users to know as they are typing if the email is unique. Is there a way to tell Yii to do Ajax validation for a form field on keyup (instead of on change)?
0

#2 User is offline   Stephen51 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 09-May 12

Posted 03 October 2012 - 10:47 AM

I got it working using the client options in the form widget.

    <?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'form-form',
    'enableClientValidation'=>true,
    'enableAjaxValidation'=>true,
        'clientOptions'=>array(
            'validateOnType'=>true,
        )
)); ?>

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