diff --git a/datapress/Forms/custom-forms/_category_.json b/datapress/Forms/custom-forms/_category_.json new file mode 100644 index 0000000..f63d2a1 --- /dev/null +++ b/datapress/Forms/custom-forms/_category_.json @@ -0,0 +1,7 @@ +{ + "label": "Custom Forms", + "position": 1, + "link": { + "type": "generated-index" + } +} diff --git a/datapress/Forms/custom-forms/custom-forms-example.md b/datapress/Forms/custom-forms/custom-forms-example.md new file mode 100644 index 0000000..21a087b --- /dev/null +++ b/datapress/Forms/custom-forms/custom-forms-example.md @@ -0,0 +1,137 @@ +--- +title: Custom Forms examples +sidebar_position: 9 +slug: /forms/custom-forms-example +tags: + - Form + - DataPress +keywords: [DataPress custom form] +--- + +:::note +The plugin previously known as **Dataverse Integration** has been renamed to **DataPress**. All references in documentation and UI are being updated accordingly. [1](https://docs.alexacrm.com/forms/custom-forms/) +::: + +## Custom form examples + +### 1. Update a Contact + +``` +{% form entity="contact" mode="update" record=record|to_entity_reference %} +
+{% endform %} +``` + +### 2. Contact Us Form (Create) + reCAPTCHA + +``` +{% form entity="lead" mode="create" recaptcha=true %} + +{% endform %} +``` + +### 3. Date Only & Date Time fields + +``` +{% form entity="contact" mode="create" %} + +{% endform %} +``` + +### 4. Display extracted date/time values + +``` +Use Twig + HTML to build custom forms and send submissions directly into Dataverse.
+ +# Overview + +Custom Forms let you capture data from your WordPress site **without** using Power Apps or Dynamics 365 forms. +Instead, you build the layout yourself using regular HTML form markup and wrap it inside Twig tags. + +Key capabilities: +- Build any HTML layout using your own design. +- Map form fields to Dataverse table columns via input `name` attributes. +- Submit data directly into Dataverse (create or update records). +- Optionally add reCAPTCHA protection. + +Custom Forms are included in the **free** DataPress plugin on WordPress.org. + +--- + +# Configuration + +## 1. Wrap your HTML form with `{% form %} ... {% endform %}` + +A custom form begins with a pair of Twig tags: +`{% form ... %}` → configuration +`{% endform %}` → closing tag + +Inside them, you **must** place a standard HTML `` element. +The submit event is handled automatically when the user submits the form. + +## 2. Connect form inputs to Dataverse columns + +Use the Dataverse column logical name for each ``: + +```html + + +``` + +The plugin uses these names to map the values to Dataverse. + +## 3. Enable reCAPTCHA (optional) + +To protect from spam: + +- Add recaptcha=true to `{% form %}`. +- Add the placeholder `