Hi All,
I want to fire up form validation when I click the ajax button.is there a way to do this in yii.
Regards
Ilakya
Page 1 of 1
form validation before ajax call
#2
Posted 03 March 2012 - 04:21 AM
Hi,
you can search this string on google "yii + ajax based validation example" than go through first 5-6 help sites.
Thanks
you can search this string on google "yii + ajax based validation example" than go through first 5-6 help sites.
Thanks
Yii Help
http://phpyiiwebapp.wordpress.com/
http://phpyiiwebapp.wordpress.com/
#3
Posted 21 March 2012 - 01:31 AM
Hi
I know that it is possible to have ajax validation that is triggered on blur event of a form element.But if a user doesn't touch even a single form element and then he clicks on submit button which is a CHtml::ajaxSubmitButton... Form validation is not done...
Is there a solution for this
Regards
Ilakya
I know that it is possible to have ajax validation that is triggered on blur event of a form element.But if a user doesn't touch even a single form element and then he clicks on submit button which is a CHtml::ajaxSubmitButton... Form validation is not done...
Is there a solution for this
Regards
Ilakya
#4
Posted 21 March 2012 - 02:53 AM
Hi ,
Have you tried using :
in your controller?
Have you tried using :
echo CActiveForm::validate(array($model));
in your controller?
Ilakya, on 21 March 2012 - 01:31 AM, said:
Hi
I know that it is possible to have ajax validation that is triggered on blur event of a form element.But if a user doesn't touch even a single form element and then he clicks on submit button which is a CHtml::ajaxSubmitButton... Form validation is not done...
Is there a solution for this
Regards
Ilakya
I know that it is possible to have ajax validation that is triggered on blur event of a form element.But if a user doesn't touch even a single form element and then he clicks on submit button which is a CHtml::ajaxSubmitButton... Form validation is not done...
Is there a solution for this
Regards
Ilakya
#5
Posted 07 June 2012 - 06:26 AM
to trigger ajax validation when the submit button is clicked, add the following to the form declaration in your view
so the form declaration should look something like this;
'clientOptions'=>array('validateOnSubmit'=>true,),so the form declaration should look something like this;
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'order-form',
'enableAjaxValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
Share this topic:
Page 1 of 1

Help











