Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About talofo

  • Rank
  1. If you wish to use rules(), for validating a form that has fields for more then one model and, one of those models (the n on a 1-N relation), needs to be inserted more then once, you have not the possibility to do it with Yii, unless, you get "hacky". It seems Yii doesn't call the javascript responsible for the N models each time they are rendered, no matter if you do it trough ajax or without it. A component (extended) to activate the errors was necessary and a trickery on performAjaxValidation method was also necessary to make this work. Otherwise, no dice. If someone actual
  2. Not matter what we do, we can't get the validation messages to appear inside those ajax loaded render partials views: When we submit or if we tab navigate the form fields, the _form does display the messages while the _member don't show nothing. I will try to resume the relevant code here: TEAM Controller public function actionMember($index){ $model = new TeamMember(); if (Yii::app()->request->isAjaxRequest) { $this->renderPartial('_member',array( 'model'=> $model, 'index'=> $index )); } } MEMBER Model return array( array('team_id, name, birthdate, email, phone
  3. Sir Larry, ok... this will be big. Hope you (and others) have the patience and nervers to all of this "newbilities". The good parts (if any) I learned from your Book. (like the relations on models). The bad parts... totally uppon my creation. Let's imagine a form with this structure, where [ ] are buttons on that form: TEAM team name: team address: MEMBERS member name: member phone: [ADD NEW MEMBER] [SUBSCRIBE TEAM] Here are the goals: 1) Validations should happen both, client and server side; (on team and member fields) 2) A flashMessage should appear at the very end
  4. I thought I've found the solution. I was wrong. I can more or less deal with it, if I use a select field so that the user chooses first, how many members they want to add. If I try to make the "add more" button instead, I need to tell Yii that those new added fields need also to be validated. Scenarios... Need to try and try again - argthh. Cheers.
  5. Hello all, First of all, thanks a trillion for the book. It covers a lot of nice topics. This question is related with a difficulty that I (and perhaps others) may have, regarding a multi model form implementation. Let's say we have a form that should allow a TEAM SUBSCRIPTION and it's members. Obviously, Team is one table, members are another. They do have a relation. Tricky part: This form as a "add new member" button that should visually, display a new member fieldset (render partial?) to be added with more members fields. (And with this, comes a lot of assumptions like): W
  • Create New...