Documentation ⇢ Form Code

Form Code


Overview

MachForm is designed to create forms that can be integrated easily with your website. Using the multiple embed code options, you will be able to use the form in your site using any method you are familiar with.

The Interface

The code manager displays multiple form codes that you can easily copy and paste into your web page. By changing the “Form Code Type” dropdown, different embed code options will be displayed to suit your needs.

Choosing a Form Code

There are six embed codes you can choose to use in the form. These are Javascript Code, Iframe Code, PHP Form File, PHP Form Code, Simple Link and Popup Link. Depending on your website and the CMS you are using, one embed code might prove to be better than the others.

Using The Javascript Code

The Javascript Code is the recommended code to embed the form in your web page. Using this code, the form will blend seamlessly with your web page and most people won’t even notice it. Under the hood, the Javascript code basically displays your form inside an iframe. However, the Javascript is smart enough to expand the height of your iframe as needed.

As this code is intended to integrate the form into your existing web page seamlessly, the form’s background, border, and logo header won’t be displayed.

Using The Iframe Code

If you are using CMS that doesn’t allow the use of Javascript code, then this iframe code should be your second choice. You might need to adjust the height of the iframe manually so that the Submit button of your form can be displayed properly.

Using the PHP Embed Code

If you are using PHP pages and not HTML pages, embedding the form using PHP code could significantly improve the loading time of your form. No iframe is used when using this form code to ensure that the form is integrated into your page completely.

However, when you are using PHP embed code, the code may conflict with your existing PHP codes, particularly if you are using any CMS on your site. Thus, it is not guaranteed to work on all pages. In case of failure, use Javascript/Iframe Code instead.

Using the PHP Form File

This file will display your form without using any iframe. Your form will be displayed as a stand-alone form, complete with its background, header, and logo. The file must be uploaded to the same server as you used for your machform installation.

If you are using Flash websites, the PHP form file might be your best option because you can upload this file and link to the file from your flash pages.