Prefill form from data that is displayed on same webpage.

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