Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Chris Harders
Chris Harders
6,166 Points

How to pre-fill a form with URL parameters in JS?

I am not sure where to find this solution in the lessons...

I am setting up an orderform and would like to grab parameters in a URL and pre-fill hidden form values that are then added to the order.

I am lost with how to have the value in the URL pass to a form field. Can someone help me with this? Or suggest which lesson I should be searching in for this?

I am in the front-end developer track but scanning through the upcoming lessons, nothing stands out as the solution to this.

1 Answer

Steven Parker
Steven Parker
228,991 Points

It's not clear to me if you're describing s server-side or client-side task. Is there an existing website that does what you have in mind you could use as an example?