Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Using Two Model Fields In One Form

$
0
0
In my application have two models user and address. The data saved to two tables using one form. But for validation purpose, only one model form fields are validated if all fields are empty. Means if we just submit the form without enter any data in form, the error message (like "City cannot be blank") happens only for one model. i want to display error for both models.
i checked these posts.
1. http://www.yiiframework.com/wiki/218/how-to-use-single-form-to-collect-data-for-two-or-more-models-cactiveform-and-ajax-validation-edition/
2. http://www.yiiframework.com/wiki/19/how-to-use-a-single-form-to-collect-data-for-two-or-more-models/

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>