ajax validation on an emongodocument
mesongo opened this issue · 13 comments
ajaxvalidation on an emongodocument activerecord with an embedded document fails to return errors.
can you show some code?
Yeah...
Code in view
<div class="col-md-6 col-sm-12 col-xs-12">
<?php echo $form->textField($user,'name[lname]', array('class'=>'form-control', 'placeholder'=>'Last Name')); ?>
<?php echo $form->error($user,'name[lname]', array('class'=>'alert-form-field-error')); ?>
</div>
</div>
code in model
// name = fname + lname
array('name','subdocument','type'=>'one',
'rules'=>array(
array('fname, lname','required')
)
),
Yeah subdocument errors have always been a problem (mainly because there is no real easy way to deal with them, Yii message showing is not capable of it), though I think I actually made this specific case work, let me test
Okey
I haven't forgot about this, I am having to test this more tomorrow since it seems my home server isn't running correctly.
Still waiting and why are you using just function instead of explicitly
declaring them as public for the models e.g function rules.
On May 20, 2014 11:21 PM, "Sammaye" notifications@github.com wrote:
Yeah subdocument errors have always been a problem, though I think I
actually made this specific case work, let me test—
Reply to this email directly or view it on GitHubhttps://github.com//issues/217#issuecomment-43677729
.
What do you mean?
Ha the irony, I have already tested this.
On the user controller edit action of my test app I actually use two fields which are subdocuments and the errors (as just tested) are working for them: https://github.com/Sammaye/MongoYii-test/blob/master/protected/controllers/UserController.php#L86
I will clean the code up a little to make it less....raw
Oh hang on I have found something
Ok I foudn that due to my use of references on subdocuments that the errors were not displaying correctly but instead they were only showing the first error, I have commited a fix.
Ok cleaned up my test repo as well, it should show the use of it a lot better now.
Please stop posting spam messages here
Mesongo Collins would like to connect on LinkedIn. How would you like to respond?
View Mesongo Collins's profile: https://www.linkedin.com/blink?simpleRedirect=0PcPkQd30NcP8Zh4BOpm9JpmQCt7xBt5ZBr6BCrT9MfndQ9CZOpmwZrioQfmBI9z4MnT9Bp6VFrmlOnThPpnlDnThPsCBCfmJB9DpMrzRQ9DsPbmBOcmBzujtFbmlDpmJOczRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I5986926486869807106_500&markAsRead=
You are receiving Reminder emails for pending invitations. Unsubscribe here: https://www.linkedin.com/blink?simpleRedirect=6RLoQkO9m9Rq7hFpQkO9nBIs6lOc3gBdPsOe3kRd2QRp3ASc38Me3sToCoRoCgPp3gQpjhAcjkQejcQpmcVp3gPcS5zcjxybjgNdzgOejcPbmB2cylVr71BszRIqm5JpioMdz0MczRAqioMc3wMc3kPd34Nd3gSczASe3ARfmhFpOoNc5ZOpmhKqmRBsBZQsSlRpRZQsT9FpzRHpipQu6lQnS9RsSVRbjkJoDlPrDkJcj1vsClArCBJpn9vt7dBtmtvt7dOqmoJr6RBfmtKqmJzon9Q9CZLpPRQ9DsPbmBOcmBzujtFbmlDpmJOczRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I5986926486869807106_500&markAsRead=
You received an invitation to connect. LinkedIn will use your email address to make suggestions to our members in features like People You May Know. Unsubscribe here: https://www.linkedin.com/blink?simpleRedirect=7sPbmBOcmBzujtFbmlDpmJOczRAqmkCjjBBc4VJc555rPxOkSZvh54VlQVvu30JpkYVoQlIuj1vdkRVnQ5fc68JrApybmxOsDxks58Rr5legShCknhIhB1JsmdIs4pJoiQPckZygTh2rT5npn1eoSRpu35zmzx2h7tIekh8t4l4sPdooz1SpSx3gSZUhkoVq4lClAhodTcQnPdEuBBFrjgTbloOrRZWu5l1gk5Du4gVgPxasmsQkklhgjRAqmZI9z4MnT9Bp6VFrmlOnThPpnlDnThPsCBCfmJB9B4ScSh5hSxmhD9JhB51fmVBqSZkp6BJ9CVRr3RQ9DsPbmBOcmBzujtFbmlDpmJOczRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I5986926486869807106_500&markAsRead=This email was intended for Sammaye/MongoYii. Learn why we included this at the following link: https://www.linkedin.com/blink?simpleRedirect=3wUdPgZp4BBr6dFt79x9z4MnT9Bp6VFrmlOnThPpnlDnThPsCBCfmJB9CNOlmlzqnpOpldOpmRLt7dRoPRx9DsPbmBOcmBzujtFbmlDpmJOczRBfP9SbSkLrmZzbCVFp6lHrCBIbDtTtOYLeDdMt7hE&msgID=I5986926486869807106_500&markAsRead=
© 2015, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA