Prefill form from data that is displayed on same webpage.

I have an eCommerce store through my wix site. I need to collect additional data from the customer once their order is complete. This information will be put in a separate database. I already know how to set up the form and get it to submit to the database that I need. The issue that I am having is figuring out a way to prefill one of the fields.

Currently, I am having the customer manually type in the order number from the thank you message below. While this does accomplish what I need there is always a risk of the customer typing in the incorrect order number.

I would like to be able to pull the order number from below and prefill it into the order number field option to be submitted with the rest of the data. I have included a screen shot of what my thank you page looks like. I also included the link that goes directly to the base thank you page. I browsed around for awhile and couldn’t find a post that addressed this issue. Any advice on how to get this done would be great. Or if there is already a post if you could point me in the right direction.

https://www.gamewithobsidian.com/thank-you-page

If you are using the Thank You page, then can’t you just simply use getOrder function to get the order number and use that value to autofill the element for you, plus any other elements that you want from the order details too.
https://www.wix.com/corvid/reference/$w.ThankYouPage.html
https://www.wix.com/corvid/reference/$w.ThankYouPage.html#getOrder

I think you mean can :wink: Specifically this line

let orderNumber = order.number;

Thanks for the response! I guess I didn’t realize or didn’t think through the fact that all the hidden info would pull to the thank you page as well. So simple!