Webflow sync, pageviews & more.
NEW

Hi Webflow Community, has anyone successfully used a custom code workaround to make a CMS field automatically populate a paragraph or text form field? I recall a tip from 2016 advising to add a "hand-coded" form in the dynamic embed code and populate the input tags with dynamic data. If anyone has experience with this or could provide a custom code snippet, I would greatly appreciate it. Thank you!

TL;DR
  • Use an HTML Embed inside a Collection Page or List and manually build your form with standard HTML.
  • Insert CMS field values using Webflow's Add Field tool within input value="" attributes or inside <textarea>...</textarea>, ensuring the embed is within a CMS context for bindings to work.

If you want to pre-populate a form input or text field with CMS data in Webflow, you can do so using an HTML Embed component within a Collection Page or Collection List. This method allows dynamic CMS fields to be inserted inside form fields via custom code.

Here’s how to do it:


1. Use an HTML Embed Inside a Collection Page or List

  • Go to the page or section where you're using a Webflow CMS Collection Page or Collection List.
  • Drag an HTML Embed component into the page or inside the Collection Item element.
  • Inside the embed, manually create your form or form fields using HTML.

2. Insert Dynamic CMS Fields in Input or Textarea

  • Use Webflow’s Add Field button (the purple + Add Field within the HTML Embed modal) while editing the <input> or <textarea> tag attributes.

  • Example for a paragraph text or textarea pre-filled with a CMS field:

    ```html

    \`\`\`
  • Or for a single-line <input>:

    ```html

    \`\`\`
  • Replace your-cms-field-name with the actual Slug (not label) of your CMS field.


3. Ensure the Embed Is Inside a CMS Scope

  • This workaround only works inside CMS context, such as:

  • A Collection Page (e.g., /blog-post)

  • A Collection List on any page

  • If used outside CMS scope, the dynamic bindings won’t appear.


4. Style Your Custom Form (Optional)

  • Use standard CSS or Webflow utility classes to style the embedded form elements.
  • You can also add Webflow classes manually within the <input> by including class="your-webflow-class" and style that class in Designer.

Summary

To auto-populate form input or paragraph fields with CMS content, use an HTML Embed block inside a CMS Collection context. Insert the dynamic CMS fields using Webflow’s field binding inside standard form element attributes like value="" or between <textarea>...</textarea>. This method bypasses Webflow's form limitations using custom code inside the CMS-aware context.

Rate this answer

Other Webflow Questions