Forms

Form blocks are used to collect information from website visitors and, if applicable, create records in the database. To add a form to a website page, drag and drop the Contact & Forms categorical building block, then select a block in the pop-up window.

추가 작업

By default, submitting a form sends an email containing the visitor’s submitted information. Depending on the apps installed on the database, additional actions that can automatically create records may become available. To choose a different action, click Edit, select a form field, navigate to the Style tab, and, in the Form section, select the desired Action:

By default, submitting the form redirects visitors to a Thank you page. Use the URL field to send them to a different page. Alternatively, select Nothing or Show Message in the On Success field to keep visitors on the form’s page.

It is also possible to define the Labels Width, specify whether fields are Required or Optional in the Marked Fields, and define a Mark Text to indicate required fields.

팁

Configure the visibility settings for forms.

필드

To add a new field to the form, navigate to the Style tab and click the + Field button in the Form or Field header section. To modify any field on the form, select the field, then use the options available in the Field section of the Style tab. For example, you can:

  • 필드 유형 을 변경합니다.

    팁

    데이터베이스에서 :guilabel:`기존 필드`를 선택하고 포함된 데이터를 사용할 수도 있습니다. 사용 가능한 필드는 선택한 작업에 따라 다릅니다. 데이터베이스에 추가된 속성 필드도 사용할 수 있습니다.

    모든 양식 유형

    일부 필드의 경우 비주얼 면에서는 유사하지만, 반드시 데이터를 특정 형식에 맞추어 입력해야 합니다.

  • 필드의 라벨 을 편집하고 위치 를 조정합니다.

  • 필드 :guilabel:`설명`을 활성화합니다. 스위치를 켜고 양식의 기본 설명을 클릭하여 수정합니다.

  • :guilabel:`필수`필드인지 여부를 지정합니다.

  • Use the Requirement field to add validation Conditions to ensure customers enter valid information. For example, set the condition requiring the Email field to contain an @ symbol.

  • :ref:`애니메이션 <website/elements/animations>`을 추가합니다.

  • Edit the field’s visibility settings.

Depending on the selected field, the following options are available:

For text & string fields, such as Text, Long Text, Email, and Url, as well as numerical fields, such as Telephone, Number, and Decimal Number, you can define a Placeholder and a Default Value.

For the Long Text field, you can also specify the field’s Height.

To apply the changes, click Save.

팁

Modify the text of the Submit button by clicking it and entering the desired text. Then, change the Button Position in the Submit Button section of the Style tab.

Odoo가 아닌 웹사이트에 Odoo 연락처 양식 추가하기

iframe을 사용하여 다른 웹사이트에 Odoo 문의 양식을 표시할 수 있습니다. 이렇게 하려면 다음 단계를 따르세요.

  1. Prepare the Odoo form: Create a contact form on a page in Odoo Website and remove the header and footer design. Make sure only the contact form remains on the page.

  2. 임베드 가능한 코드 생성: Odoo 양식 페이지의 URL을 복사하여 La Digitale.dev 또는 `iFrame Generator <https://www.iframe-generator.com/>`_와 같은 iframe 생성기에 붙여넣으세요. 올바른 표시를 위해 너비와 높이를 조정하세요.

  3. Add the embedded code to the non-Odoo website: Open the relevant page’s HTML (in the code editor or CMS) and insert the embedded code where the form should be displayed.

Example

임베디드 코드 예시:

<iframe src="https://example.com/odoo-form"
        style="border:0;"
        name="odooForm"
        scrolling="no"
        frameborder="0"
        marginheight="0"
        marginwidth="0"
        height="400px"
        width="600px"
        allowfullscreen>
 </iframe>