The method I used was to have sub-forms written in PHP and loaded via an AJAX call done with JQuery.
In reality, the AJAX called a PHP responder and passed a value with the form name. The form was retrieved [with include(...)
] and the resultant HTML captured using output buffering.
The folder layout I used was:
lib
|
+-subforms
| |
| +-admin
| | +-aform1.php
| | +-aform2.php
| | + :
| | + aformn.php
| |
| +-client
| | +-cform1.php
| | +-cform2.php
| | + :
| | + cformn.php
|
+-supportFunctions.php
where lib
refers to the include path for the app
The AJAX call passed the value selected in a drop-down box which correlates to the form name to retrieve.