---
title: Defining custom form layout
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The layout of a form is the HTML output code that the system renders on pages when you add the form. It determines how the form's fields are organized, and overall how the form appears to visitors.

After you define a form (using the [Form builder](https://docs.kentico.com/k12sp/managing-website-content/forms/designing-forms-using-the-form-builder.md) or the [Field editor](https://docs.kentico.com/k12sp/managing-website-content/forms/designing-forms-using-the-field-editor.md)), the form uses a default layout. The default layout consists of either a table or _\<div>_ elements containing the form's fields, depending on the configuration of the given [form web part or widget](https://docs.kentico.com/k12sp/managing-website-content/forms/displaying-forms-on-the-live-site.md). When using the default layout, the form's structure and field order is fully controlled by the field definitions on the **Fields** or **Form builder** tab.

If you are not satisfied with the default form layout, you can create your own custom layout for individual forms. The custom layout can be defined on the **Layout** tab of a form's editing interface in the **Forms** application.

To modify the default layout of a form:

1. Open the **Forms** application.
2. Edit () a form.
3. Switch to the **Layout** tab.
4. Select **Use custom form layout**.
5. Select **HTML** or **ASCX** as the **Layout type**.
6. Click the **Generate default layout** button.

   - This generates a table containing all fields in the form with appropriate labels, input controls and validation controls.
   - Alternatively, you may select the Layout element and field and click the **Insert** button. This allows you to select which fields appear in the form, and their exact locations within the form's output code.
7. Alter the appearance of the form using actions on the text editor toolbar or by editing the layout code (click the **Source** button on the editor toolbar to access the code directly).

   - For example, type text above the form, select it and apply the **Heading 2** format through the text editor toolbar.

     ![Defining a custom layout for a form](https://docs.kentico.com/docsassets/k12sp/defining-custom-form-layout/editing_form_layout.png "Defining a custom layout for a form")
8.  (Optional) Click **Attachments** in the tab's header to upload files with the form.
   - The form's attachments can then be pasted into the layout using the **Paste to text** button.
9. Click **Save** to save the new layout.

You have changed the form layout. If you have already added the form to the live site, its appearance changes automatically.
