Yii Framework Forum: Ajax Validation in Render Partial - Yii Framework Forum

Jump to content

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

Ajax Validation in Render Partial ajax validation not in partial render Rate Topic: -----

#1 User is offline   ByteChip 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 01-August 12

Posted 13 August 2012 - 03:33 AM

I generated a form, enabled the ajax validation and it works fine with I use 'render'.
I want this form to be a part of another page,so I used renderPartial, the ajax validation is not working.
Tried couple of searches in the the forum and found no good solution. Any help will be appreciated. Thanks :-)
0

#2 User is offline   alirz23 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 826
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 13 August 2012 - 04:02 AM

what error do you get?
0

#3 User is offline   ByteChip 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 01-August 12

Posted 14 August 2012 - 12:13 AM

The fields are not getting validated on the fly if i do renderPartial. However it works fine if I use render.
There is no such error I get, just that the ajax validation is not working.
0

#4 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,166
  • Joined: 05-January 12
  • Location:Morocco

Posted 14 August 2012 - 07:15 AM

Use it like this:
$this->renderPartial('yourView', array(), false, true);

From http://www.yiiframew...Partial-detail:

Quote

renderPartial() method

public string renderPartial(string $view, array $data=NULL, boolean $return=false, boolean $processOutput=false)

$view - string - name of the view to be rendered. See getViewFile for details about how the view script is resolved.

$data - array - data to be extracted into PHP variables and made available to the view script

$return - boolean - whether the rendering result should be returned instead of being displayed to end users

$processOutput - boolean - whether the rendering result should be postprocessed using processOutput.

{return} - string - the rendering result. Null if the rendering result is not required.

1

#5 User is offline   vijay24 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 18-January 14

Posted 03 February 2014 - 12:22 AM

View Postbennouna, on 14 August 2012 - 07:15 AM, said:

Use it like this:
$this->renderPartial('yourView', array(), false, true);

From http://www.yiiframew...Partial-detail:

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