Yii Framework Forum: Dynamically Added "sub-Forms" In An Outer Form - Multiple Submission Of The Inner Ones And Then The Outer One - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Dynamically Added "sub-Forms" In An Outer Form - Multiple Submission Of The Inner Ones And Then The Outer One Rate Topic: -----

#1 User is offline   zifnab 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 13-December 13

Posted 13 December 2013 - 04:13 AM

Hi,

I would like to have a form from model A and in the form an ajax call that will be producing (partial) forms from a different model B. I would like to be able to submit these dynamically produced inner forms when I submit the outer one - any ideas how this can be done?
I will have something like that
<form outer>  
Create Car:


Car Types: 
<input:AutoComplete from already available car types> or add new (nested form) with ajax
<form inner/>Create new Car Type:   type:<input/><form inner/>
...
...
<form inner/>Create new Car Type:   type:<input/><form inner/>  


</form>


The inner forms are creating new objects that their ids will be used to do insertions in join table car_type
when I submit the outer I want the inner forms (that I know what model they are going to be validated against) to be submitted and then to return some ids that I will use in the join table insertions, then validate the outer form and submit it as well - the number of inner forms are not known in advance as they are produced dynamically through ajax..

Thank you in advance :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users