Forms

Forms let the visitor enter text or select options. The content of the form will be sent to other page once Submit button is pressed.

To add a form choose Form > New Form. Double click the form to edit it. To add more controls choose Form > menu. You can also add text objects (labels) with Insert > Text command.

  1. Label
  2. Input Field
  3. Radio Choice
  4. Checkbox
  5. Drop Down List
  6. List Choice
  7. Text Area
  8. Submit Button
  9. Hidden Field

Form Processing

Afte pressing Submit button, the browser reads data from all fields belonging to the form (for example Form1) and sends the data to the destination page.

  1. Form item, for example Form1
  2. Input Field
  3. Text Area
  4. Submit Button
  5. Form Link
  6. PHP code processing form data

The destination page must use PHP code to read variables and to process them, for example send them by email or write to a database. The file name of the destination page must have .php extension. To enable PHP on the destination page choose Page > Setup and Enable PHP.

Also the destination page must run through PHP processor, usually your web server. To have forms working you must publish the form online and open the page through http:// protocol. It is not possible to run the code without web server (by opening .php file from your local hard disk).

Linking Form to destination page

After pressing Submit button, the browser loads a destination page and sends form data to it.

Select the form and choose Action > Link. Choose form's destination page or enter external URL. Data entered in form controls will be sent to this page.

POST method will send form data invisible.

GET method will send data in the query string visible in the browser address field. The GET method is useful if you want to create an URL with some data already present and use the link for example in your email.

If you choose GET method the query string generated by the form will look similar to this:

http://www.website.com/destinationpage.php?first_name=John&last_name=Smith&age=35

Variable name

Each control of the form must have unique ID (variable name). Select the control and press F2 to view the name of the control. Input fields are usually named Input1, Input2 where Check boxes are usually named Check1, Check2, etc.

Steps required to proces a form:

  1. Create a form with Form > New Form. Double click it and create controls inside the form.
  2. Choose Insert > Page to create a destination page that will receive form data.
  3. Choose Insert > PHP and select "Display form fields sent to this page". Insert the code wherever on the destination page.
  4. Go back to the page with form.
  5. Select the form and choose Action > Link, select the destination page.
  6. Choose Website > Upload or Website > Export to Folder and upload files to the server.
  7. Open your page with the browser (with http:// protocol) and test the form.

Reading form data

Variables sent to the page are available in $_REQUEST array. Use PHP code to handle these variables, for example the following code will display Input1 variable:

echo $_REQUEST["Input1"];

Note: PHP code works on the web server only. It does not work when previewing the page on local disk.

Controls

All form controls must be placed inside the form. If the control is placed outside the form, its variable will not be sent to the destination page. Double click the form to enter it.

Label and Input Field

Choose Insert > Text or Insert > Paragraph to place text descriptions.

Choose Form > Input Field or click button.

List Choice

Choose Form > List Choice or click button. Allows to select an option form the list or select multiple options with Shift or Ctrl key pressed.

Radio Choice

Choose Form > Radio Choice or click button. Selection is exclusive.

Text Area

Choose Form > Text Area or click button. This control accepts new line breaks and allows to enter more the one line of text.

Check Box

Choose Form > Check Box or click button. This control allows to choose yes or no.

Drop Down List

Choose Form > Drop Down List or click button. Allows to select an option form the drop down list.

Submit Button

Choose Form > Submit Button or click button. The button doesn't need any click action defined.

Hidden Field

The form can contain additional variables. To add hidden fields select the form and choose Item > Properties. Enter hidden variables, each in a new line and separate variable and value with = sign, for example:

Hidden1=This is hidden value
Hidden2=This is another hidden value
The button doesn't need any click action defined.