# Autofill product name into form

**URL:** <https://forum.wixstudio.com/t/autofill-product-name-into-form/25288>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [February 18, 2020, 4:03am UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288 "2020-02-18T04:03:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hartadam9](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/hartadam9/32/10170_2.png) [@hartadam9](https://forum.wixstudio.com/u/hartadam9)\
**Post date:** [February 18, 2020, 4:03am UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288/1 "2020-02-18T04:03:20Z")

</div>

Hi, I’m trying to create a way in which a form field can be auto-filled with the name of the product they clicked from, like a quote button.  
So if I click the button on a product page for a certain motorcycle, the form field of “motorcycle” already has the product name in it.  
I appreciate any help, I’m new to code and I’m struggling.

---

<div class="post-metadata">

**Author:** ![yevheniias](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yevheniias/32/3202_2.png) [@yevheniias](https://forum.wixstudio.com/u/yevheniias)\
**Post date:** [February 18, 2020, 7:50am UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288/2 "2020-02-18T07:50:58Z")

</div>

To prefill the value you will need to use wixQuery and query the collection to find the relevant value.  
[https://www.wix.com/code/reference/wix-data.html#query](https://www.wix.com/code/reference/wix-data.html#query)  
Check out these forum posts:  
[https://www.wix.com/corvid/forum/community-discussion/pre-fill-form-fields-with-values-from-previous-record](https://www.wix.com/corvid/forum/community-discussion/pre-fill-form-fields-with-values-from-previous-record)  
[https://www.vorbly.com/Vorbly-Code/WIX-CODE-AUTO-FILL-FORM-WITH-USER-INPUTS](https://www.vorbly.com/Vorbly-Code/WIX-CODE-AUTO-FILL-FORM-WITH-USER-INPUTS)  
[https://www.wix.com/corvid/forum/community-discussion/prefill-textbox-using-wixcode](https://www.wix.com/corvid/forum/community-discussion/prefill-textbox-using-wixcode)

You can also find a lot of posts on this matter if you browse the forum:  
[https://www.wix.com/corvid/forum/search/prefill](https://www.wix.com/corvid/forum/search/prefill)  
[https://www.wix.com/corvid/forum/search/auto-fill](https://www.wix.com/corvid/forum/search/auto-fill)

Good luck!

---

<div class="post-metadata">

**Author:** ![chloe](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@chloe](https://forum.wixstudio.com/u/chloe)\
**Post date:** [March 23, 2021, 8:52pm UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288/3 "2021-03-23T20:52:50Z")

</div>

Hi! I’m having the same issue as Adam. None of the referenced posts work correctly. The closest is the Vorbly Code post, however, it fills in my field with the word “title” instead of referencing the title field in the dynamic database. I’ve read these posts extensively and most are wanting to fill in member data, and don’t quite work in my situation. If you have any other thoughts or advice, that would be very helpful!!

---

<div class="post-metadata">

**Author:** ![arthur-terebinto](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@arthur-terebinto](https://forum.wixstudio.com/u/arthur-terebinto)\
**Post date:** [October 18, 2022, 4:15pm UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288/4 "2022-10-18T16:15:59Z")

</div>

Greetings, I need to pick up the product name for a field on my form. This is already working for me:

$w ( “#input10” ). placeholder = “Product Name” ;

But now i need to change the producy name to a dynamic value that changes accordingly to the product displayed on the page .

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [October 20, 2022, 2:07pm UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288/5 "2022-10-20T14:07:40Z")

</div>

Please open your own post and describe your issue in detail.  
You can link this post if needed.

---

<div class="post-metadata">

**Author:** ![arthur-terebinto](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@arthur-terebinto](https://forum.wixstudio.com/u/arthur-terebinto)\
**Post date:** [October 20, 2022, 3:04pm UTC](https://forum.wixstudio.com/t/autofill-product-name-into-form/25288/6 "2022-10-20T15:04:31Z")

</div>

Here! [https://www.wix.com/velo/forum/coding-with-velo/autofill-product-name-into-the-contact-form](https://www.wix.com/velo/forum/coding-with-velo/autofill-product-name-into-the-contact-form)
