# Dynamic Default Values

**URL:** <https://community.hubspot.com/t/dynamic-default-values/21297>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [June 1, 2020, 10:05am UTC](https://community.hubspot.com/t/dynamic-default-values/21297 "2020-06-01T10:05:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bburak](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bburak/32/30191_2.png) [@bburak](https://community.hubspot.com/u/bburak)\
**Post date:** [June 1, 2020, 10:05am UTC](https://community.hubspot.com/t/dynamic-default-values/21297/1 "2020-06-01T10:05:26Z")

</div>

Hi there,

When I use Wufoo Forms, it’s really easy to modify default values

Example:

```auto
 <script type="text/javascript">var asdasdmj;(function(d, t) {
 var s = d.createElement(t), options = {
 'userName':'myusername',
 'formHash':'zx300',
 'host':'wufoo.com',

  'defaultValues':'field34=<?php the_title(); ?>',

 };
 </script>

```

I could not find a solution for Hubspot,  
I wish something like this:

```auto
<script>
 hbspt.forms.create({
 portalId: "XXXX",
 formId: "XXXX",
 defaultValues: { myfield33 : <?php the_title(); ?> }
});
</script>

```

or I wish

`[hubspot type=form portal=111111 id=XXXX my-field-33="mytext"]`

I have tried this:  
[https://developers.hubspot.com/manipulating-forms-with-jquery](https://developers.hubspot.com/manipulating-forms-with-jquery)

> **[Auto-populate form fields with a query string](https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string)**
>
> Learn how to auto-populate field values in a form on a page by adding query strings to the page URL.

Could not find a solution.

I don’t have an access my client’s account. They’re just giving shortcode or embeded JS code. Is there anything I can do?

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [June 2, 2020, 3:30am UTC](https://community.hubspot.com/t/dynamic-default-values/21297/2 "2020-06-02T03:30:52Z")

</div>

Hey @bburak,

By modifying the default values do you mean that you’d like to set a form value on the form field when the form loads?

If so, you can do something like this:

```auto
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
 <script>
 hbspt.forms.create({
 portalId: 'portalId',
 formId: 'formId',
 onFormReady: function($form) {
 $form.find('input[name="stringtest"]').val("kitkat2").change();
 }
 });
 </script>
 {{ standard_footer_includes }}
 </body>
</html>

```

---

<div class="post-metadata">

**Author:** ![bburak](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bburak/32/30191_2.png) [@bburak](https://community.hubspot.com/u/bburak)\
**Post date:** [June 2, 2020, 7:46am UTC](https://community.hubspot.com/t/dynamic-default-values/21297/3 "2020-06-02T07:46:27Z")

</div>

Thank you.  
That’s the what I want.
