FORMfields, the premiere web framework
Login
Support Home | Knowledge Base | Documentation | Forums | Contact Us
Info
FORMfields & FORMgen :: Formatting

Inserting Your Form Statically

(4138 views. Last Updated: 2007-09-20 1:04 PM)

Here is an example how to statically insert your form into an existing webpage. In this example we will assume that you have a very basic webpage called template.php that is located in FORMfields/forms and that template.php looks like:
<html>

<head>
<title>Template Title</title>
</head>

<body>
</body>

</html>

Furthermore, we will assume that your generated form is FORMfields/forms/generated/my_form.php. To add my_form.php to template.php, edit template.php and insert the 3 sections from my_form.php.

  • Section 1 should be placed directly before your initial tag.

  • Section 2 should be placed directly before your closing tag.

  • Section 3 should be placed in your tag in the location where you'd like the form to be displayed.


Note: Each section is enclosed within PHP code like: "<? /* BEGIN - SECTION 2 */ ?><? /* END - SECTION 2 */ ?>", however the 1st section starts at the top of the form and ends with "<? /* END - SECTION 1 */ ?>"

Your merged form then becomes:
...
<? /* END - SECTION 1 */ ?>
<html>

<head>
<title>Template Title</title>
<? /* BEGIN - SECTION 2 */ ?>
...
<? /* END - SECTION 2 */ ?>
</head>

<body>
<? /* BEGIN - SECTION 3 */ ?>
...
<? /* END - SECTION 3 */ ?>
</body>

</html>

Note: There is 1 drawback to this method: if the user changes my_form.php, say using FORMgen, the changes will not be reflected in template.php. Therefore, we recommend that you consider Creating a Template For Your Form: http://www.formfields.com/support/viewPosting.php?pi=103.
Info
Support | Earn Money
Copyright © 2005-2019 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.