# Pre-populate a form field value on generate.js rendered Forms

**URL:** <https://forum.mautic.org/t/pre-populate-a-form-field-value-on-generate-js-rendered-forms/15952>\
**Category:** Product Support\
**Tags:** discussion, development\
**Created:** [September 4, 2020, 2:32pm UTC](https://forum.mautic.org/t/pre-populate-a-form-field-value-on-generate-js-rendered-forms/15952 "2020-09-04T14:32:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![downloads.ch](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/downloads.ch/32/1061_2.png) [@downloads.ch](https://forum.mautic.org/u/downloads.ch)\
**Post date:** [September 4, 2020, 2:32pm UTC](https://forum.mautic.org/t/pre-populate-a-form-field-value-on-generate-js-rendered-forms/15952/1 "2020-09-04T14:32:37Z")

</div>

Hi Community

I really like the automated Mautic Form HTML using the links /form/generate.js?id=FROM-ID 🙂  
I’m looking for an easy way to define some prefilled forms, (e.g. the Context of Form Submits)

Search throught the forums I’ve found only this post which allows prefilled form on _mautic hosted landing pages_: [How to pass URL parameters to a form - #14 by robm](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/14)

* * *

**Is there a similar solution to define prefilled, mostly hidden fields, for forms delivered by the automated html using the /form/generate.js?id=FROM-ID?**

The only solution I’ve found is copy the manual Form HTML Code, and injecting the hidden fields manually, as it’s described here. [Managing forms | Mautic](https://docs.mautic.org/en/components/forms/managing-forms?_ga=2.108267458.1789075526.1599224912-1278022431.1599224912#pre-populate-a-form-field-value)

Unfortunately this breaks the simplicity of the generate.js Forms and needs a lot of maintenance when changing forms and their fields.

What I’m looking for is something like this:

> `<script type="text/javascript" src="https://mautic.org/form/generate.js?id=1&product_id=MY-PREDEFINED-VALUE" async="async"></script>`

> where product\_id is the hidden field, used to distinguish the context of the shared contact form.

_Is something like this available or planned?_

_Thanks a lot for your feedbacks_ 😃

* * *

ps: Is there a place to customize the output of the script generate.js? I couldn’t find it in the source easily.
