Yii Framework Forum: Clientside Validation Not Submitting Form After Validation - Yii Framework Forum

Jump to content

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

Clientside Validation Not Submitting Form After Validation Rate Topic: -----

#1 User is offline   sheraz.s 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 11-June 13

Posted 25 June 2013 - 10:52 AM

Hi, i am implementing clientside form validation. But the problem is it is not submitting form after validation. It works fine if any error occurs but if there is no error in form validation then it does not submit form. please guide me where i am wrong


<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'comingsoon-csoon-form',
			'enableAjaxValidation'=>true,
                	'enableClientValidation'=>true,
                	'clientOptions'=>array('validateOnSubmit'=>TRUE, 
                        'validateOnChange'=>true, 
                        'afterValidate'=>"js:function(form, data, hasError) {
			            
                	if(hasError == true){						
			     if( $('.result').is(':hidden') )
				 $('.result').slideDown();
			         return false;
			     }
			else{						
			     //alert('else');						
                             return true;
			}
                    }")
		        )); 
                ?>



0

#2 User is offline   sheraz.s 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 11-June 13

Posted 25 June 2013 - 01:19 PM

is there anyone on YII forum who can help me??
0

#3 User is offline   sheraz.s 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 11-June 13

Posted 26 June 2013 - 12:26 AM

Please help me, i am unable to understand what is the problem here. Just give me some hint ???
0

#4 User is offline   sheraz.s 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 11-June 13

Posted 26 June 2013 - 12:30 AM

What i am trying to do is, i am validating form via ajax and if any error occurs then i will show error in a popup and apply error class on text fields. after successful validation , i am hiding the error popup and applying success class on textfields.
Everything is working fine but form is not being sent. please help me what is wrong in this code or suggest me a better solution to do this.
0

#5 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 550
  • Joined: 09-April 10

Posted 26 June 2013 - 01:16 AM

Try disabling ajax validation and see if a valid form will submit.

Matt
0

#6 User is offline   Ankit Modi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 908
  • Joined: 19-February 13
  • Location:India

Posted 26 June 2013 - 01:22 AM

Hi,

Please see it..

http://www.yiiframew...__1#entry208536
Thanks,
Ankit Modi
Skype : amodi06
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