I have a form that uses multiple of the same model. When the user clicks "add item" it creates a new row (in this case a elements of a 'model') to ActiveForm. This is important in cases when you have a form where the amount of items needed to be added are unknown and rather than have the user navigate multiple pages I would like to use one form. I found a way to save these elements but currently my method (I'm using renderAjax()) loses its client validation for the new elements.
I would like to know if anyone has had experience in using ActiveForm and Ajaxing in new form elements from models and still retain client validation.
Thanks in advance.
Not exactly a cookie cutter method like some JS frameworks but this works.
Clone this attr:
Then modify and add to ActiveForm:
I'm not exactly sure if I messed something up or if its intended this way but validation is working now.