I have two models Parent and Child. In the Parent form I am allowing the user to adding Childs based on the One2Many relation between Parent and Child. Then I need to prevent him from adding more than X number of Childs, how to achieve
this
I have two models Parent and Child. In the Parent form I am allowing the user to add Childs based on the One2Many relation between Parent and Child. Then I need to prevent from adding more than X number of Childs, how to achieve this?
Right now I am able to check the number of added childs using OnChange(). and the alert message appears to the user that he acceded the limit of childs.
Assume the limit is 3 childs, how can I do the following:
After adding the 4 childs, show alert message (this already done), then delete the last added child(s) that acceds the limit
Or, once childs max limit achieved, hide the "Add an Item" link