Your page should have one form only.
Make 2 divs. Top div has your fixed fields including the one that triggers the variable content.
Use jquery to catch the change event for the field. When the field changes send an Ajax request to the server.
Let the server build the variable form and return it to the server to populate the second div.
I build the individual form elements rather than using FORM or SQLFORM. That way I avoid form within a form problems.
Thank Cliff and Massimo for your help.
I have finally make in very similar fission:
I have 2 divs,
controller1 with static form with id=1 that inserted in div1,
another controller2 that triggers by w2p_component (ajax) and generates form with id=2 and inserted to div2 but all input fields of this form has HTML 5 attribute "_form=1",
Plus I have button with the same "_form=1"
So when I submit/click the button -both forms submitted vars get to the controller1 and inserted to the same record of my db table.
It works well for me.
This approach did not work when I insert my forms from controller1 via LOAD helper
Regards
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/jNsHXtD0VqI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.