Javascript is not the right tool for this job.You should submit the first form to a server-side script, such as PHP, so that the server-side script can then build the next page with information from the previous page.

If however you insist on using JavaScript, your form is highly likely to fail. JavaScript is completely optional, and you need to understand that it should not be used for any fundamental behaviours.Having said that, here is code to access the querystring via JavaScript.

JavaScript can only access forms that are submitted via "get". Forms that are submitted via "post" are not in any way accessible via JavaScript. You come back to requiring server-side code for such requirements.