Reputation: 385
I have added three form elements
Upvotes: 0
Views: 124
Reputation: 1810
Sibin,
There are many ways to do it.
As you have separate elements that menas you have create different-different form tags for all different form and once they are submitted then it will go to specific controller and action so it is very simple here.
If you have kept one form tag for all your element then you can keep your text boxes name different for different-different models.
like:
For defineroute.ctp
data[model1][field1] data[model1][field2]
singleroute.ctp data[model2][field1] data[model2][field2]
singletrip.ct
data[model3][field1] data[model3][field2]
Once they form is submitted then you will one array containing different model array like:
data[model1]=>array(field1, field2) data[model2]=>array(field1, field2) data[model3]=>array(field1, field2)
Now you can perform save action and enjoy madi!!!
Upvotes: 1