-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Field with the Same Name on a Page #310
Comments
You should probably use a collection and set of views there, so each model
|
I have a unique setup so let me back up.. We've built a CMS that doubles as a rest API and serves up my site. Every section and field on the page are dynamically generated, which is what we use to build the views. Also, as every field gets built, I push the validation rules onto the user model from the field meta data passed in on the API. Every time a user interacts with one of these fields we set our user models with an attribute as the same name as the field name. Then when saving we save our user models. So, I've set it up to loop thru each user model and validate those attributes (not the attributes from the view). So, in order to get this to work, I've removed the view object from the callbacks (since I'm validating my user object instead of the view). But then the final problem comes when highlighting the problem field. I realize this is a major outlier, but it would be nice to get the model that I'm validating passed in so I can use some of those additional attributes. |
I have a situation where a user might be signing up for him/herself + guests, which creates multiple fields with the same field name. It would be nice if we could pass the model object to the valid/invalid functions from the isValid() and validate() functions. This would allow me to use the model's cid to create a unique class on each field and target them from within the pluggin.
The text was updated successfully, but these errors were encountered: